import java.io.*;
import java.util.*;
public class PayCalculator {
private final static double OT_START = 40.0;
private final static double OT_ADJUST = 0.5;
private final static double TAX = 0.2;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Input Hours worked <1 week> \n-->");
double hours = input.nextDouble();
System.out.println("Input Hourly pay \n-->");
double rate = input.nextDouble();
System.out.println();
System.out.println("Net pay: $%2f\n", calculateNetPay(hours, rate));
System.out.println("Hours until overtime: %6.2f\n", OT_START);
System.out.println("Overtime adjustment: %7.2f%%\n", OT_ADJUST);
System.out.println("Tax rate: %.2f%%\n", TAX);
}
private static double calculateNetPay(double hours, double rate) {
double gross;
if(hours <= 40)
gross = rate * hours;
else
gross = rate * 40 + rate * 1.5 * (hours - 40);
return gross - 0.2 * gross;
}
}
My errors are:
line 28: cannot find symbol method println(java.lang.String,double)
line 29: cannot find symbol method println(java.lang.String,double)
line 30: cannot find symbol method println(java.lang.String,double)
line 31: cannot find symbol method println(java.lang.String,double)
I'm not really sure what I did wrong.

New Topic/Question
Reply



MultiQuote



|