Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An airline describes airfare as follows. A normal ticket's base cost is $500. Persons aged 65 or over have a base cost of $450. Children

An airline describes airfare as follows. A normal ticket's base cost is $500. Persons aged 65 or over have a base cost of $450. Children 3 or under have $0 base cost. A single carry-on bag costs $0, but a second carry-on is $10. The first two checked bags are free, the third is $50, and each additional is $75. Given inputs of age, carry-on (0, 1, or 2), and checked bags (0 or greater), compute the total airfare. Hints: First use an if-else statements to assign airFare with the base cost Use another if statement to update airFare for a carryOn Finally, use another if-else statement to update airFare for checked bags Think carefully about what expression correctly calculates checked bag cost when bags are 3 or more

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago