Answer to Question #246007 in C++ for vina

Question #246007

An events ticket booking System prompts the user to make a choice as well as the number of tickets required. It then displays the total cost of the order. The menu options and cost per ticket is as follows: 1 Exclusive VIP area A : R3 000.00 2 VIP area B : R2 000.00 3 Elevated area :R1200.00 4 General area R600. 0 QUIT


1
Expert's answer
2021-10-03T16:19:44-0400
using namespace std;


/*
	An events ticket booking System prompts the user to make a choice as well as the number of tickets required. 
	It then displays the total cost of the order. The menu options and cost per ticket is as follows: 
	1 Exclusive VIP area A : R3000.00 
	2 VIP area B : R2000.00 
	3 Elevated area :R1200.00 
	4 General area R600. 
	0 QUIT
*/




int main()
{
	int Flag=-1;
	int Price[5] = {0,3000, 2000, 1200, 500};
	int Count=0;
	
	while(Flag<0 ||Flag>4)
	{
		cout<<"\n\tPress 1 to select Exclusive VIP Area A:";
		cout<<"\n\tPress 2 to select VIP Area B :";
		cout<<"\n\tPress 3 to select Elevated Area:";
		cout<<"\n\tPress 4 to select General Area:";
		cout<<"\n\tPress 0 to QUIT";
		cout<<"\n\tEnter Option: "; cin>>Flag;
		if(Flag==0) exit(0);
		if(Flag>0 && Flag<5)
		{
			cout<<"\n\tEnter No. of tickets: "; cin>>Count;
			cout<<"\n\tTotal Cost = "<<Count*Price[Flag];
		}
	}
}

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