Question: C++ code please 4.17 Custom Lab: Branches : Cascading if-else-statements An airline describes airfare as follows. A normal ticket's base cost is $300. Persons aged
4.17 Custom Lab: Branches : Cascading if-else-statements An airline describes airfare as follows. A normal ticket's base cost is $300. Persons aged 60 or over have a base cost of $290. Children 2 or under have $0 base cost. A carry-on bag costs $10. A first checked bag is free, second is $25, and each additional is $50. Given inputs of age, carry-on ( 0 or 1 ), 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
Get step-by-step solutions from verified subject matter experts
