Hi - I am in a beginning Java class and cannot figure out this assignment. We were given steps to do and I thought I had done them right but what I didn't expect were a whole bunch of 'cannot find symbol - variable XXX' for all of my variables (tuition, fees, rate, etc) which were declared.
Could someone take a look and help? I have to turn this in at noon....
Thanks in advance!!!
import java.io.*; import java.text.DecimalFormat; public class Tuition { public static void main(String[] args) throws IOException { //Declaring Variables int hours; double fees, rate, tuition; BufferedReader myIn= new BufferedReader(new InputStreamReader(System.in)); // Call Methods displayWelcome(); hours = getHours(); rate = getRate(hours); tuition = calcTuition(hours, rate); fees = calcFees(tuition); displayTotal(tuition + fees); } public static void displayWelcome() { System.out.println("\tWelcome to the Tuition and Fees Estimator"); } public static int getHours() { //declare method variables String strHours; int hours = 0; try { System.out.print("\t\tEnter the total number of hours enrolled: "); strHours = myIn.readLine(); hours = Integer.parseInt(strHours); } catch(NumberFormatException e) { System.out.println("An error has occurred. You must enter an integer. " + e.getMessage()); //message prints with Java-generated data } return hours; } public static double getRate(int hours) { if (hours > 15) { rate = 44.50; } else { rate = 50.00; } return rate; } public static double calcTuition(int hours, double rate) { tuition = hours * rate; return tuition; } public static double calcFees(double tuition) { fees = tuition * .08; return fees; } public static void displayTotal(double total) { DecimalFormat twoDigits = new DecimalFormat("$#,000.00"); System.out.println("\t\tYour total tuition and fees are " + twoDigits.format(tuition + fees) + "."); System.out.println("\t\tThank you!"); } }