Answer to Question #273046 in C++ for alden

Question #273046

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




1
Expert's answer
2021-11-29T06:52:11-0500
#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<<" ";
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS