import java.util.*; class Demo1 { public static void main(String[] args) { int grandTotal=0,subtotal=0; Scanner scan = new Scanner(System.in); System.out.println("Welcome, please enter your name:"); String name = scan.nextLine(); System.out.println("Enter your mobile number:"); String mobile = scan.next(); String item =""; int price=0; char c='y'; System.out.println("______________________________________________"); System.out.println("________________ Menu _________________"); System.out.println("______________________________________________"); System.out.println("1 Idly 30"); System.out.println("2 Dosa 50"); System.out.println("3 Water bottle 20"); System.out.println("4 Tea 08"); System.out.println("5 Coffee 10"); System.out.println("6 Boost 12"); System.out.println("______________________________________________"); while(c=='y') { System.out.println("What do you want to buy? \nEnter the code:"); int choice = scan.nextInt(); System.out.println("Can you enter the quantity:"); int quan = scan.nextInt(); switch(choice) { case 1: item = "Idly"; price = 30; subtotal = price*quan; break; case 2: item = "Dosa"; price = 50; subtotal = price*quan; break; case 3: item = "Water Bottle"; price = 20; subtotal = price*quan; break; case 4: item = "Tea"; price = 8; subtotal = price*quan; break; case 5: item = "Coffee"; price = 10; subtotal = price*quan; break; case 6: item = "Boost"; price = 12; subtotal = price*quan; break; default: System.out.println("Invalid input!!!"); break; } grandTotal += subtotal; System.out.println("Do you want to continue(y/n)?");//Y,N,Yes, No, y, n c = scan.next().toLowerCase().charAt(0); } System.out.println(grandTotal); } }