import javax.swing.JOptionPane;
public class cafe2
{
public static void main(String args[])
{
String name,ch;
double price = 0.00;
double sum=0.00;
int cho=0;
name=JOptionPane.showInputDialog("Enter
Customer Name:");
do{
ch=JOptionPane.showInputDialog(
" Food Name "+
"\n-----------------------------------------------------"+
"\n1) French Fries $ 3.50"+
"\n2) Fish and Chips $ 5.50"+
"\n3) Goat Cheese Pizza $20.70"+
"\n4) Chicken Salad $ 8.90"+
"\n5) Spaghetti $ 9.00"+
"\n6) Chicken Chop $ 9.50"+
"\n7) Lamb Chop $10.50"+
"\n\n Beverages "+
"\n-----------------------------------------------------"+
"\n8) Ice Blended Mocha $ 5.60"+
"\n9) Cafe Classic Martini $13.00"+
"\n0) EXIT"+
"\n\n PLEASE Enter Item No. :");
cho=Integer.parseInt (ch);
switch (cho) {
case 1: price= 3.50;
break;
case 2: price= 5.50;
break;
case 3: price= 20.70;
break;
case 4: price= 8.90;
break;
case 5: price= 9.00;
break;
case 6: price= 9.50;
break;
case 7: price= 10.50;
break;
case 8: price= 5.60;
break;
case 9: price= 10.50; break;
default: System.out.println("Invalid
choice.");
}
}
while(cho!=0);
sum = sum + price;
JOptionPane.showMessageDialog(null,
"RECEIPT"+
"\n*********"+
"\nCustomer Name: "+name+
"\n\nTotal Price: $"+sum);
System.exit(0);
}
}
//*** PROBLEM IS I CANT GET THE TOTAL IN
//THE END