Write a C++ code that will conduct an interview for stewardess. If all the criteria as in the table below is fulfilled, the result will be “You Got The Job”. For unsuccessful candidates, the result will be “Try Again”. Unsuccessful candidates are those who did not fulfil the criteria below.
Age-Between 20 till 25
Height-Between 168 cm till 175 cm
Weight-Between 45 till 50 kg
English grade - A or B
SOLUTION CODE
#include <iostream>
using namespace std;
int main()
{
//prompt the interviewee to enter the required data
int age;
double height;
double weight;
char english_grade;
cout<<"\nEnter your age: ";
cin>>age;
cout<<"Enter your height in centimetres: ";
cin>>height;
cout<<"Enter your weight in kilograms: ";
cin>>weight;
cout<<"Enter your english grade: ";
cin>>english_grade;
if((age>= 20 && age<=25) && (height>= 168 && height<=175) && (weight>= 45 && weight<=50) && (english_grade=='A' || english_grade == 'B'))
{
cout<<"\n\nYou Got The Job"<<endl;
}
else
{
cout<<"\n\nTry Again"<<endl;
}
return 0;
}
SAMPLE PROGRAM OUTPUT
Comments
Leave a comment