/*C++ Program that simulates an ordering system*/ #include using namespace std; int main() { char choice; //Declare choices for user input and total bill float T_Bill = 0; printf("Welcome to 'Maes-Resto'!\n"); printf("May I take your order?\n"); printf("Press '1' - Yes, Press '2' - No: "); cin >> choice; if (choice == '1'){ cout << "===================================\n"; printf("Do you want an appetizer?\n"); printf("Press '1' - Yes, Press '2' - No: "); cin >> choice; cout << "===================================\n"; switch (choice){ case '1': printf("Choose from the following options:\n"); printf("A: Salad\tB:Soup\n"); printf("Your Choice: "); cin >> choice; switch (choice){ //Jumps to labels' SALAD, SOUP, or MAINMENU case 'A': goto SALAD; case 'B': goto SOUP; } case '2': goto MAINMENU; } } else { printf("Thank you so much for coming to 'Maes-Resto'!"); exit(0); //Terminates the code } SALAD: { const float TV_Salad = 7.95, C_Salad = 5.00; //Price of products cout << "===================================\n"; printf("SALAD MENU:\n"); cout << "A: Thai Vermicelli Salad $" << TV_Salad << endl; cout << "B: Ceasar Salad $" << C_Salad << endl; printf("Your Choice: "); cin >> choice; switch (choice){ //Adds the price to the total bill case 'A': T_Bill += TV_Salad; break; case 'B': T_Bill += C_Salad; break; } goto MAINMENU; //Jumps to MAINMENU } SOUP: { const float TY_Soup = 10.95, CT_Soup = 9.00; cout << "===================================\n"; printf("SOUP MENU:\n"); cout << "A: Tom Yum Soup $" << TY_Soup << endl; cout << "B: Clear Tofu Soup $" << CT_Soup << endl; printf("Your Choice: "); cin >> choice; switch (choice){ case 'A': T_Bill += TY_Soup; break; case 'B': T_Bill += CT_Soup; break; } goto MAINMENU; } MAINMENU: { const float EBF_Fillets = 20.05, MG_Salmon = 25.25, CC_Bleu = 22.99; cout << "===================================\n"; printf("MAIN COURSE MENU:\n"); cout << "A: Easy Baked Fish Fillets $" << EBF_Fillets << endl; cout << "B: Miso-Glazed Salmon $" << MG_Salmon << endl; cout << "C: Chicken Cordon Bleu $" << CC_Bleu << endl; printf("Your Choice: "); cin >> choice; switch (choice){ case 'A': T_Bill += EBF_Fillets; break; case 'B': T_Bill += MG_Salmon; break; case 'C': T_Bill += CC_Bleu; break; } goto CHECKOUT; // Jumps to CHECKOUT } CHECKOUT: float pay; while (true) { //Loops infinetely until user provided sufficient payment cout << "===================================\n"; cout << "Total amount: $" << T_Bill << endl; cout << "Payment: $"; cin >> pay; if (pay >= T_Bill){ cout << "Change: $" << (pay - T_Bill) << endl; cout << "Thank you so much for coming to 'Maes-Resto'!\n"; break; //Stops the loop } cout << "Insufficient amount!\n"; } }