C++
Toll roads have different fees at different times of the day and on weekends. Write a function CalcToll() that has three arguments: the current hour of time (int), whether the time is morning (bool), and whether the day is a weekend (bool). The function returns the correct toll fee (double), based on the chart below.
Weekday Tolls
Weekend Tolls
Ex: The function calls below, with the given arguments, will return the following toll fees:
CalcToll(8, true, false) returns 2.95CalcToll(1, false, false) returns 1.90CalcToll(3, false, true) returns 2.15CalcToll(5, true, true) returns 1.05
Your program should include the function main( ), which asks for and validates the proper user inputs to be passed to the CalcToll( ) function. The function main() also displays the toll fees based on the user inputs.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here