The class is BookCost.Java
this project is called BookCost
i have already done a part of it, but it won't compile, i dont know why it won't compile.
It says that the highlighted part can not be double.
can anybody gives me some suggestions plz?
thank you and have a great day
Here is my problem here:
And here is my source code with some problem.
public class BookCost
public static final double BP_PRIZE = 18.95;
public static final double NB_PRIZE = 21.95;
public static double getOrderTotal(int bp, int nb)
amount = bp + nb;
if ( amount >= 12)
total = 14.00 * ( bp + nb);
else if ( amount <= 12 && amount >= 3)
total = 15.95 * ( bp + nb);
else if ( bp == 1 && nb == 1)
total = 37.95;
else if ( bp + nb < 3)
total = (bp * BP_PRIZE) + (nb * NB_PRIZE);
public static void main (String args)
Scanner kb = new Scanner (System.in);
System.out.println("Welcome to Hans's book calculating program!");
System.out.println("This program is designed for managing how"
+ "\n much does it cost for the user's order.");
System.out.println("Now please enter the number of <Be Prepared> books you want to order!");
bpint = kb.nextInt();
bp = (int)(bpint + 0.5);
System.out.println("I got the number sir!");
System.out.println("Now please enter the number of <Next Bes> books you want to order!");
nbint = kb.nextInt();
nb = (int)(nbint + 0.5);
System.out.printf("Your prize is" + getOrderTotal(total));