Javascript Loops – have problems with calculations

import java.util.Scanner;
import javax.swing.JOptionPane;
public class homework four
Scanner static scan = new scanner (System.in);
// declaring variables
Private static string name, jOptionInput;
private static int menuChoice, quantity, totalQuantity = 0;
static double private price = 0, saleTax = 0, total amount;



Empty main static public (String[] args) {
javax.swing.SwingUtilities.invokeLater (new Runnable () {
public vacuum execution () {

// entering name
System.out.print ("Please enter your name:");
name = scan.nextLine ();

System.out.println ("");

// Printing the menu
System.out.println ("MENU");
System.out.println ("1. Face painting $ 50");
System.out.println ("2. Globe spinning $ 45");
System.out.println ("3. Puppet shows $ 55");
System.out.println ("4. Stilt walkers $ 60");
System.out.println ("5. Bounce house $ 80");
System.out.println ("6. Rock wall $ 70");
System.out.println ("7. Petting zoo $ 65");
System.out.println ("10. Exit");

System.out.println ("");

// using the loop to read the selected menu and the quantity and exit when the ten are entered
while (true)
{
System.out.print ("Please select your options:");
menuChoice = scan.nextInt ();
if (menuChoice == 10) {break;}
jOptionInput = JOptionPane.showInputDialog (null, "How many hours do you want?", "Number of hours", JOptionPane.INFORMATION_MESSAGE);
quantity = Integer.parseInt (jOptionInput);
// calculoCost call method to calculate the cost
totalQuantity = totalQuantity + quantity;
calculateCost (menuElection, quantity);
}
// obtaining the sales tax and the total amount
saleTax = price * (0.065);
totalAmount = price + saleTax;

// printing the screens a receipt of this information
System.out.println ();
System.out.println ("Thank you for placing an order with Fantasy Entertainment," + name);
System.out.println ("Total ordered items:" + totalQuantity);
System.out.println ("Price of ordered food: $" + price);
System.out.println ("Sales tax: $" + saleTax);
System.out.println ("Total amount due: $" + totalAmount);
System.out.println ("You saved: $" +);
}});}


public static void calculaCost (int menu, int quantity) {
// calculating the cost of sale
switch (menu)
{
Case 1:
price = price + (quantity * 50);
break;
Case 2:
price = price + (quantity * 45);
break;
Case 3:
price = price + (quantity * 55);
break;
Case 4:
price = price + (quantity * 60);
break;
Case 5:
price = price + (quantity * 80);
break;
Case 6:
price = price + (quantity * 70);
break;
Case 7:
price = price + (quantity * 65);
break;
default:
break;
}

}
}

PHP:

I went differently with that. I need to do the following for the last exit, which is "You have saved: $"

There are two promotions that are:

  1. If you select facial paint and balloons -> $ 10 discount
  2. If you select all options -> $ 80 discount

SEMrush