Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three parameters: the current hour of time (int), whether the time is morning (boolean),...


I need help solving this in PYTHON


Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three parameters: the current<br>hour of time (int), whether the time is morning (boolean), and whether the day is a weekend (boolean). The function returns the correct toll<br>fee (float), based on the chart below.<br>Weekday Tolls<br>• Before 7:00 am ($1.15)<br>• 7:00 am to 9:59 am ($2.95)<br>• 10:00 am to 2:59 pm ($1.90)<br>• 3:00 pm to 7:59 pm ($3.95)<br>• Starting 8:00 pm ($1.40)<br>Weekend Tolls<br>• Before 7:00 am ($1.05)<br>• 7:00 am to 7:59 pm ($2.15)<br>• Starting 8:00 pm ($1.10)<br>Ex: The function calls below, with the given arguments, will return the following toll fees:<br>calc_toll(8, True, False) returns 2.95<br>calc_toll(1, False, False) returns 1.90<br>calc_toll(3, False, True) returns 2.15<br>calc_toll(5, True, True) returns 1.05<br>337634 2041158.gx3zgy7<br>

Extracted text: Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three parameters: the current hour of time (int), whether the time is morning (boolean), and whether the day is a weekend (boolean). The function returns the correct toll fee (float), based on the chart below. Weekday Tolls • Before 7:00 am ($1.15) • 7:00 am to 9:59 am ($2.95) • 10:00 am to 2:59 pm ($1.90) • 3:00 pm to 7:59 pm ($3.95) • Starting 8:00 pm ($1.40) Weekend Tolls • Before 7:00 am ($1.05) • 7:00 am to 7:59 pm ($2.15) • Starting 8:00 pm ($1.10) Ex: The function calls below, with the given arguments, will return the following toll fees: calc_toll(8, True, False) returns 2.95 calc_toll(1, False, False) returns 1.90 calc_toll(3, False, True) returns 2.15 calc_toll(5, True, True) returns 1.05 337634 2041158.gx3zgy7

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here