Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed 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.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

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago