Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a program to calculate the toll to be paid on a toll road. The toll to be paid is dependent on the day

C++image text in transcribed

Write a program to calculate the toll to be paid on a toll road. The toll to be paid is dependent on the day and the time. The program should ask the user for the day and time and then print out the toll to be paid. Use the chart below to determine the toll. See sample output The following function should be used: determine Toll - this function is pass in the hour of the day as an integer, whether it is am or pm as a character, and whether it is weekend or weekday as a character in that order. The function should return the the toll to be paid. Assume the user types in valid input Define the function below main and put the prototype before main. Note: Write thoughts on paper before you start coding! Weekday Tolls Before 7:00 am ($1.10) 7:00 am to 10:59 am ($2.55) 11:00 am to 3:59 pm ($1.85) 4:00 pm to 7:59 pm ($4.25) Starting 8:00 pm ($1.50) Weekend Tolls Before 7:00 am ($1.00) 7:00 am to 5:59 pm ($2.35) Starting 6:00 pm ($1.15) Sample Output #1 Enter the hour: 8 Is it AM or PM (A or P): P Is it Friday or Saturday (Y/N): Y Amount owed: $1.15 Sample Output #2 Enter the hour: 2 Is it AM or PM (A or P): P Is it Friday or Saturday (Y/N): n Amount owed: $1.85

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

Students also viewed these Databases questions

Question

Compare Web 2.0 and Web 3.0.

Answered: 1 week ago

Question

13. You always should try to make a good first impression.

Answered: 1 week ago