Assigned seat
#include<iostream>
using namespace std;
int main()
{
int num;
int x;
do
{
cout<<"\tAirline company"<<endl;
cout<<"\t***Class Menu"<<endl;
cout<<"\tDesigned by Brian Kibet"<<endl;
cout<<"\tReg no: s08-6317-2020.";
cout<<"\tFor the Purpose of the CAT";
cout<<"\n1.Enter 1 to reserve a seat in a BUSINESS class";
cout<<"\n2.Enter 2 to reserve a seat in an ECONOMY class";
cout<<"\n3.Exit the program";
cout<<"\nPlease Enter your choice of class: "<<endl;
cin>>num;
switch(num)
{
case 1:
{
if(x==1)
cout<<"\nYou have been assigned seat number: 01 in the BUSINESS class";
else if(x==2)
cout<<"\nYou have been assigned seat number:02 in the BUSINESS class";
else if(x==3)
cout<<"\nYou have been assigned seat number: 03 in the BUSINESS class";
else if(x==4)
cout<<"\nYou have been assigned seat number: 04 in the BUSINESS class";
else if(x==5)
cout<<"\nYou have been assigned seat number: 05 in the BUSINESS class5";
else if(x==6)
cout<<"\nYou have been assigned seat number: 06 in the BUSINESS class";
else//x=>6
cout<<"\nThe BUSINESS class is full.";
cout<<"\nSince the BUSINESS class is full, would you like to reserve a seat in the ECONOMY class...???";
cout<<"\nif No";
cout<<"\nSorry. Please wait for the next flight that leaves in 5 hours.";
break;
}
case 2:
{
if(x==7)
cout<<"\nYou have been assigned seat number:07 in the ECONOMY class";
else if(x==8)
cout<<"\nYou have been assigned seat number:08 in the ECONOMY class";
else if(x==9)
cout<<"\nYou have been assigned seat number: 09 in the ECONOMY class";
else if(x==10)
cout<<"\nYou have been assigned seat number:10 in the ECONOMY class";
else if(x==11)
cout<<"\nYou been assigned seat number: 11 in the ECONOMY class";
else if(x==12)
cout<<"\nYou have been assigned seat number:12 in the ECONOMY class";
else//x<7||>12
cout<<"\nThe ECONOMY class is full.";
cout<<"\nSince the ECONOMY class is full, would you like to reserve a seat in the BUSINESS class...???";
cout<<"\n if No.";
cout<<"\n Sorry. please wait for the next flight that leaves in 5 hours.";
break;
}
case 3:
exit(0);
default:
cout<<"\nInvalid Class choice... Please Enter 1 || 2 to continue with your reservation";
}
}
while(num==3);
return 0;
}