Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An airline describes airfare as follows: A first class ticket is $2,350. An economy ticket is $1,645. A non-refundable economy ticket is $1,445 The passenger

image text in transcribed
image text in transcribed
An airline describes airfare as follows: A first class ticket is $2,350. An economy ticket is $1,645. A non-refundable economy ticket is $1,445 The passenger may bring up to two checked bags. The first is $25, and the second is $35. The passenger may bring one pet in an approved carry-on bag. The cost for the pet is $95. Given inputs of fare class (F/E/N). checked bags (0, 1, or 2), and pet (y), compute the total airfare. Output with a $ in front You may assume that all input values will be valid. Hints First use an if-else statements to assign airfare with the base cost Then use another if-else statement to update airfare for checked bags Then use another if-else statement to update airfare for the pet 1 #include 2 using namespace std; 3 4 int main() { 5 6 /* Type your code here. */ 7 8 return 0; 9}

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

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

List the steps in the succession management process.

Answered: 1 week ago