Question: In this midterm coding exercise zyLab, you have unlimited Develop Mode runs and unlimited Grade Mode submissions. Make sure you complete both zyLabs for full
In this midterm coding exercise zyLab, you have unlimited Develop Mode runs and unlimited Grade Mode submissions. Make sure you complete both zyLabs for full credit.
Toll roads have different fees based on the time of day and on weekends. Write a function calctoll 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 : am $
: am to : am $
: am to : pm $
: pm to : pm $
Starting : pm $
Weekend Tolls
Before : am $
: am to : pm $
Starting : pm $
Ex: The function calls below, with the given arguments, will return the following toll fees:
calctoll True, False returns
calctoll False, False returns
calctoll False, True returns
calctoll True, True returns In this midterm coding exercise zyLab, you have unlimited Develop Mode runs and unlimited Grade Mode submissions. Make sure you complete both zyLabs for full credit.
Toll roads have different fees based on the time of day and on weekends. Write a function calctoll 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 : am $
: am to : am $
: am to : pm $
: pm to : pm $
Starting : pm $
Weekend Tolls
Before : am $
: am to : pm $
Starting : pm $
Ex: The function calls below, with the given arguments, will return the following toll fees:
calctoll True, False returns
calctoll False, False returns
calctoll False, True returns
calctoll True, True returns
qxzqy
LAB
ACTIVITY
: EXAM: Midterm Programming
main.py
def calctollhour ismorning, isweekend:
# Type your code here.
if namemain:
printcalctollTrue, False
printcalctoll False, False
printcalctoll False, True
printcalctoll True, True
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
