Can anyone help?
I am supposed to be building a program that can calculate the fee of a customer and every time I run the program it always comes up with $10 for the fee no matter what. Can anyone see where I am going wrong?
import java.util.Scanner;
public class Bankfee
{
public static void main(String[] args)
{
double checks =0,
totalfee =0,
fee = 10,
fee1 =.1,
fee2 = .08,
fee3 = .06,
fee4 = .04,
checkFee=0;
String input;
Scanner keyboard = new Scanner(System.in);
int number;
System.out.println("Please enter the number of checks you wrote for the past month");
input = keyboard.nextLine();
if (checks < 0) // negative is false
{
System.out.print("ERROR: You cannot enter a negative amount!");
}
else if(checks >= 60)
{
checkFee =(fee4);
}
else if(checks >= 40)
{
checkFee = (fee3);
}
else if(checks >=20)
{
checkFee = (fee2);
}
else if(checks <20)
{
checkFee = (fee1);
}
//adds all fees
totalfee = (fee + checkFee * checks);
//if closing true(because user didn't enter negative number, show total fees
System.out.print("Your total monthly Bank Fees are $" + totalfee);
}
}