Question: if ( age < = 2 ) totalAirfare = 0 ; / / if age is greater than 6 0 , then there is 2

if(age <=2)
totalAirfare =0;
// if age is greater than 60, then there is 290 base cost.
else if(age >=60)
totalAirfare =290;
// otherwise base cost is 300$.
else
totalAirfare =300;
// if total number of carryOn =1, then extra charge of $10.
if(carryOn >0)
totalAirfare = totalAirfare +10;
// if checkedBags =2, then add $25 to totalAirfare.
if(checkedBags ==2)
totalAirfare = totalAirfare +25;
// if number of checkedBags >2, then
// first add $25 for second bag and then add extra $50 for each bag.
else if(checkedBags >2)
totalAirfare = totalAirfare +25+50*(checkedBags -2);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!