I need assistance with writing the below 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 hour of...


I need assistance with writing the below 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 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)



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here