Enter the Customer Name: Abcd
Enter the Type of Meal: 1
[1 for Meal 1 (Burger, Fries and Drinks) , 2 for Meal 2(Cheeseburger, Fries and Drinks), and 3 for Meal 3 (Spaghetti, Fries and Drinks)]
Enter the Number of Order: 2
Total Amount of Abcd order is: 140.00
Would you like to try again? (Y/N)?: y
********* Ordering System ***********
Enter the Customer Name: Def
Enter the Type of Meal: 2
[1 for Meal 1 (Burger, Fries and Drinks) , 2 for Meal 2(Cheeseburger, Fries and Drinks), and 3 for Meal 3 (Spaghetti, Fries and Drinks)]
Enter the Number of Order: 1
Total Amount of Abcd order is: 100.00
Would you like to try again? (Y/N)?: y
********* Ordering System ***********
Enter the Customer Name: Xyc
Enter the Type of Meal: 2
[1 for Meal 1 (Burger, Fries and Drinks) , 2 for Meal 2(Cheeseburger, Fries and Drinks), and 3 for Meal 3 (Spaghetti, Fries and Drinks)]
Enter the Number of Order: 1
Total Amount of Abcd order is: 100.00
Would you like to try again? (Y/N)?: n
#include<iostream>
using namespace std;
int main()
{
string name;
char option;
int m,order,opt;
cout<<"Enter the customer name: ";
cin>>name;
cout<<"1. for Meal 1 (Burger, Fries and Drinks)\n2. Meal 2(Cheeseburger, Fries and Drinks)\n3. for Meal 3 (Spaghetti, Fries and Drinks)]: ";
cout<<"\nEnter the Type of Meal: ";
cin>>m;
cout<<"\nEnter the number of order: ";
cin>>order;
if(m==1){
double total=70*order;
cout<<"\nTotal Amount of Abcd order is: 140.00";
}
else if(m==2){
double total=100*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else if(m==3){
double total=130*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else{
cout<<"Invalid choice";
}
cout<<"\nWould you like to try again? (Y/N)?:";
cin>>option;
if(option=='Y'||option=='y'){
cout<<"\nEnter the customer name: ";
cin>>name;
cout<<"1. for Meal 1 (Burger, Fries and Drinks)\n2. Meal 2(Cheeseburger, Fries and Drinks)\n3. for Meal 3 (Spaghetti, Fries and Drinks)]: ";
cout<<"\nEnter the Type of Meal: ";
cin>>m;
cout<<"\nEnter the number of order: ";
cin>>order;
if(option==1){
double total=70*order;
cout<<"\nTotal Amount of Abcd order is: 140.00";
}
else if(option==2){
double total=100*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else if(option==3){
double total=130*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else{
cout<<"Invalid choice";
}
}
else if(option=='n'||option=='N'){
cout<<" ";
}
cout<<"\nWould you like to try again? (Y/N)?:";
cin>>option;
if(option=='Y'||option=='y'){
cout<<"\nEnter the customer name: ";
cin>>name;
cout<<"1. for Meal 1 (Burger, Fries and Drinks)\n2. Meal 2(Cheeseburger, Fries and Drinks)\n3. for Meal 3 (Spaghetti, Fries and Drinks)]: ";
cout<<"\nEnter the Type of Meal: ";
cin>>m;
cout<<"\nEnter the number of order: ";
cin>>order;
if(option==1){
double total=70*order;
cout<<"\nTotal Amount of Abcd order is: 140.00";
}
else if(option==2){
double total=100*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else if(option==3){
double total=130*order;
cout<<"\nTotal Amount of Abcd order is: "<<total;
}
else{
cout<<"Invalid choice";
}
}
else if(option=='n'||option=='N'){
cout<<" ";
}
}
Comments
Leave a comment