I'm trying to get back the answer in my public static double method. Every time I try to compile, however, it doesn't recognize this: (double kms, double fuelEfficiency, double carIns) and says I am missing a class. I'm completely stuck why I can't get it to work.
Note: I need to actually do a lot more calculations in there, but first I want to try with it as a basic just to see if it works.
java.util.Scanner; public class budgetCalculator { public static void main(String[] args) { //Scanner Scanner scan = new Scanner(System.in); //Find out number of roommates. System.out.println("How many roommates do you have?:"); int occupancy = scan.nextInt(); //Find out rent. System.out.println("How much do you pay for rent? (in dollars):"); double rent = scan.nextInt(); //Find out car insurance. System.out.println("What do you pay for car insurance?:"); double carIns = scan.nextInt(); //Find out km driven per day. System.out.println("How many kilometres do you drive per day?:"); double kms = scan.nextInt(); //Find out mileage in car. System.out.println("What is the mileage on your car?:"); System.out.println("In case you aren't sure, an average is that:"); System.out.println("A very small car's mileage is 7.1L/100km"); System.out.println("A small car's mileage is 8.2L/100km."); System.out.println("A sport car's mileage is 14.9L/100km"); System.out.println("and an SUV's mileage is 12.3L/100km"); double fuelEfficiency = scan.nextInt(); //Find out average electric bill. System.out.println("What do you pay for electricity (every two months)?:"); double electricity = scan.nextInt(); // Find out average cable bill. System.out.println("What do you pay for cable each month?:"); double cable = scan.nextInt(); //Find out average water bill. System.out.println("What do you pay every 4 months for water?:"); double water = scan.nextInt(); //Find out average internet bill. System.out.println("What do you pay each month for Internet?:"); double internet = scan.nextInt(); //Find weekly food costs. System.out.println("What do you pay weekly for food?:"); double groceries = scan.nextInt(); //Find eating out cost. System.out.println("How much money do you spend eating out per week?:"); double resteraunt = scan.nextInt(); //Find out mweekly alcohol cost. System.out.println("How much do you spend on alcohol weekly?:"); double liquor = scan.nextInt(); System.out.println(determineTransportationCost(double kms, double fuelEfficiency, double carIns)); } public static double determineTransportationCost(double kms, double fuelEfficiency, double carIns) { double transportation = 30 * kms; return transportation; } }
Help?