We've been assigned to make a primitive shopping cart in Java in my class and I have managed to finish everything with the exception of the Hawaiian sales tax that simply refuses to work properly. I would really be grateful if someone could point out what I did wrong because everybody I ask has no clue what is the problem.
double IceCreamVanillaPrice = 2.50;
double IceCreamCCPrice = 4.50;
double IceCreamOSPrice = 3.25;
double IceCreamBCPrice = 5.00;
Scanner getInput = new Scanner(System.in);
// Setting up the menu
System.out.println("Hello! Welcome to Neal's Ice Cream Kitchen.");
System.out.println("What would you like?");
System.out.println("-----------------------------------------------
-------");
System.out.println("(1) Vanilla Ice Cream $"+
IceCreamVanillaPrice);
System.out.println("(2) Cookies and Cream Ice Cream $"+
IceCreamCCPrice);
System.out.println("(3) Orange Sherbet Ice Cream $"+
IceCreamOSPrice);
System.out.println("(4) Berry and Cherry Ice Cream $"+
IceCreamBCPrice);
System.out.println("-----------------------------------------------
-------");
System.out.println("Enter the number of the Ice Cream you want to
order.");
// Setting up the ordering system and how much they want as well as
figuring out the total cost
int numIceCream = 0;
numIceCream = getInput.nextInt();
// Vanilla Ice Cream
if (numIceCream == 1) {
System.out.println("How much Vanilla Ice Cream cones do you
want?");
int numVanilla = getInput.nextInt();
double SalesTax1 = numVanilla * IceCreamVanillaPrice + 0.04167 ;
System.out.println("Your total will be $" + SalesTax1); }
// Cookies and Cream Ice Cream
else if (numIceCream == 2) {
System.out.println("How much Cookies and Cream Ice Cream cones
do you want?");
int numCC = getInput.nextInt();
double SalesTax2 = numCC * IceCreamCCPrice + 0.04167 ;
System.out.println("Your total will be $" + SalesTax2); }
// Orange Sherbet Ice Cream
else if (numIceCream == 3) {
System.out.println("How much Orange Sherbert Ice Cream cones do
you want?");
int numOS = getInput.nextInt();
double SalesTax3 = numOS * IceCreamOSPrice + 0.04167 ;
System.out.println("Your total will be $" + SalesTax3); }
// Berry and Cherry Ice Cream
else if (numIceCream == 4) {
System.out.println("How much Berry and Cherry Ice Cream cones
do you want?");
int numBC = getInput.nextInt();
double SalesTax4 = numBC * IceCreamBCPrice + 0.04167 ;
System.out.println("Your total will be $" + SalesTax4); }
else {
System.out.println ("Sorry that is not a Valid Order"); }
System.out.println("Thank you for shopping at Neal's Ice Cream
Kitchen! Have a Nice day!");
`