Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write in c++ Write a program to calculate the toll to be paid on a toll road. The toll to be paid is dependent on
Write in 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 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 (54.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: B 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.85Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started