Question: C++ Program General Passengers (Passenger Fares Do Not Include Vehicles) Price Fuel Surcharge Adult $13.00 $1.25 Child (age 5 to 11) (Under 5 years of
C++ Program
| General Passengers (Passenger Fares Do Not Include Vehicles) | Price | Fuel Surcharge |
| Adult | $13.00 | $1.25 |
| Child (age 5 to 11) (Under 5 years of age: free) | $6.50 | $1.25 |
| Vehicles: Vehicle Fares Do Not Include Driver or Passengers | ||
| Passenger Vehicle & Trailer (Up to 7 feet high, up to 20 feet long) | $43.00 | $4.15 |
| Extra Length (per foot) | $2.15 | Nil |
| Oversize Passenger Vehicle and Trailer (Over 7 feet high, up to 20 feet long) | $69.00 | $10.40 |
| Extra Length (per foot) | $3.45 | Nil |
Extra "Per Foot" Rate: The passenger vehicle fare shown applies to a unit, or combination of units, to 20 feet in overall length. A unit, or combination, longer than 20 feet is charged this extra "per foot" rate.
You have been contracted to write a C++ program to calculate the correct fare (using the fare tariff above), based on an appropriate dialog with the customer. Your assignment is to develop in C++ a non-graphical (non-GUI) version of a fare calculator, which should ask exactly the same questions, in the same sequence, and produce exactly the same results as the example dialogs below. Note that the examples below are just that only examples. Your program should be designed to calculate the correct fare for any set of valid inputs. The text in red italic is an example of what could be input the user. Everything else is output by your program.
Example #1
Welcome to Colin Gobles Fare Calculator
How many adults (age 12 or over) are in your party? 3
How many children (age 5 to 11) are in your party? 1
Are you driving a vehicle onto the ferry? (y/n): n
Your fare is $45.50 plus a fuel surcharge of $5.00
The total amount payable is $50.50
Thank you for using Colin Gobles Fare Calculator
Example #2
Welcome to Colin Gobles Fare Calculator
How many adults (age 12 or over) are in your party? 3
How many children (age 5 to 11) are in your party? 1
Are you driving a vehicle onto the ferry? (y/n): y
What is the length of the vehicle in feet? 15
Is the vehicle over 7 feet high? (y/n): n
Your fare is $88.50 plus a fuel surcharge of $9.15
The total amount payable is $97.65
Thank you for using Colin Gobles Fare Calculator
Example #3
Welcome to Colin Gobles Fare Calculator
How many adults (age 12 or over) are in your party? 3
How many children (age 5 to 11) are in your party? 1
Are you driving a vehicle onto the ferry? (y/n): y
What is the length of the vehicle in feet? 25
Is the vehicle over 7 feet high? (y/n): n
Your fare is $99.25 plus a fuel surcharge of $9.15
The total amount payable is $108.40
Thank you for using Colin Gobles Fare Calculator
Example #4
Welcome to Colin Gobles Fare Calculator
How many adults (age 12 or over) are in your party? 3
How many children (age 5 to 11) are in your party? 1
Are you driving a vehicle onto the ferry? (y/n): y
What is the length of the vehicle in feet? 25
Is the vehicle over 7 feet high? (y/n): y
Your fare is $131.75 plus a fuel surcharge of $15.40
The total amount payable is $147.15
Thank you for using Colin Gobles Fare Calculator
Design Considerations
Your program is only expected to calculate the charge for a single group of people each time you use it. We have not studied loops yet, so you are not expected to use one.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
