Question: C++ Project You have learned that programs can make simple choices and they never get tired of repeating things. You plan to write a simple

C++ Project

You have learned that programs can make simple choices and they never get tired of repeating things. You plan to write a simple program, Airfare.cpp, which repeatedly asks the user to enter ticket information and then calculates the total price for all the tickets entered.

The price of a ticket depends on the destination. The program has information on these destinations:

Destination

One-way Price

Boston

$ 350.00

London

$ 600.00

Paris

$ 700.00

Tokyo

$ 800.00

If a ticket is requested to some other destination, the program informs the user that no tickets are available to that destination. The user can enter the city names as given or in all lower case.

The round trip price is the one-way price multiplied by 1.6. There is a 20% discount for students. The user enters this information by entering the letter Y or y to mean yes and N or n to mean no.

When the user enters the word Done or done when asked for the destination, the program outputs the total number of tickets and their total price and exits. A few sample runs are given below:

Sample Run 1

**************************************************************

Enter the information for each ticket.

When no more tickets to enter, enter 'Done' for destination.

**************************************************************

Enter the destination city: Boston

Round trip? [Y/N] N

Student discount? [Y/N] N

Enter the destination city: london

Round trip? [Y/N] N

Student discount? [Y/N] N

Enter the destination city: Done

--------------------------------------------------------------

2 tickets sold for a total sum of $950.00

--------------------------------------------------------------

Sample Run 2

**************************************************************

Enter the information for each ticket.

When no more tickets to enter, enter 'Done' for destination.

**************************************************************

Enter the destination city: London

Round trip? [Y/N] Y

Student discount? [Y/N] n

Enter the destination city: Paris

Round trip? [Y/N] N

Student discount? [Y/N] Y

Enter the destination city: london

Round trip? [Y/N] Y

Student discount? [Y/N] y

Enter the destination city: Berlin

No tickets are available to Berlin

Enter the destination city: done

--------------------------------------------------------------

3 tickets sold for a total sum of $2288.00

--------------------------------------------------------------

Sample Run 3

**************************************************************

Enter the information for each ticket.

When no more tickets to enter, enter 'Done' for destination.

**************************************************************

Enter the destination city: Lisbon

No tickets are available to Lisbon

Enter the destination city: madrid

No tickets are available to madrid

Enter the destination city: Barcelona

No tickets are available to Barcelona

Enter the destination city: Paris

Round trip? [Y/N] Y

Student discount? [Y/N] Y

Enter the destination city: done

--------------------------------------------------------------

1 tickets sold for a total sum of $896.00

--------------------------------------------------------------

Sample Run 4

**************************************************************

Enter the information for each ticket.

When no more tickets to enter, enter 'Done' for destination.

************************************************************** Enter the destination city: done

--------------------------------------------------------------

0 tickets sold for a total sum of $0.00

--------------------------------------------------------------

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!