1. Make a program that will input type of accommodation room. A-for first class, B-for second class. Charge as follows : first class=800.00 and second class = 650.00. Your program will be terminated if you input C in the accommodation room type.
#include<iostream>
using namespace std;
int main()
{
char option;
cout<<"TYPES OF ACCOMODATION ROOMS";
cout<<"Select from the list below to see corresponding charges ";
cout<<"1. Type A - First class \n 2. Type B - Second class ";
cout<<"Choose your option:";
cin>>option;
if(option == 'C')
{
cout<<"Program terminated";
}
else
{
switch(option){
case 'A':
cout<<"Charges = 800.00";
break;
case 'B':
cout<<"Charges = 650.00";
break;
default:
cout<<"Invalid option, try again with A or B ";
}
}
}
Comments
Leave a comment