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
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];
}
}
}
Comments
Leave a comment