Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions

Question

How are the securities lending market regulated?

Answered: 1 week ago