1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
galina1969 [7]
2 years ago
5

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 TollsBefore 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 TollsBefore 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.95calc_toll(1, False, False) returns 1.90calc_toll(3, False, True) returns 2.15calc_toll(5, True, True) returns 1.05
Computers and Technology
1 answer:
Oduvanchick [21]2 years ago
3 0

The toll program illustrates the use of conditional statements;

As a general rule, conditional statements are used to make decisions

<h3>The toll program</h3>

The toll program written in Python where conditional statements are used to make several decisions is as follows:

def calc_toll(hour, morning, weekend):

   toll_fee = 0

   if weekend == False:

       if morning == True:

           if hour < 7:

               toll_fee+=1.15

           elif hour < 10:

               toll_fee+=2.95

           elif hour <= 12:

               toll_fee+=1.90

       else:

           if hour < 3:

               toll_fee+=1.90

           elif hour < 8:

               toll_fee+=3.95

           elif hour >= 8:

               toll_fee+=1.40

   else:

       if morning == True:

           if hour < 7:

               toll_fee+=1.05

           elif hour <= 12:

               toll_fee+=2.15

       else:

           if hour < 8:

               toll_fee+=2.15

           elif hour >= 8:

               toll_fee+=1.10

   return toll_fee

   

Read more about conditional statements at:

brainly.com/question/24833629

#SPJ1

You might be interested in
1). What is the proper name of the healing agent?
VLD [36.1K]

Answer:

1. Hydroxychloroquine is the healing agent

2. Chloroquine does not have a hydroxyl group attached    

Explanation:              

Chloroquine and  Hydroxy chloroquine have been in use for many decades for malaria treatment and prophylaxis.    

It was found that there was a high possibility of being poisoned when treatment of chloroquine was administered. In 1946 the hydroxyl group replaced the CH3₃  (methyl) group with an ⁻OH (hydroxyl) group as indicated by the attachment. Toxicity by chloroquine was reduced to 40% when the ⁻OH group was attached.

Later chloroquine was added to formulas that are used for cleaning pools and fish tanks.

Both of these chemicals should be used by following the guide lines and under medical supervision if taken for any illness.

3 0
3 years ago
Repeated execution of a set of programming statements is called repetitive execution.
Korolek [52]

Answer:

False

Explanation:

6 0
2 years ago
Software that displays advertising material when online.
liubo4ka [24]

Answer:

adware

Explanation:

Adware is a software that shows ads etc online, but also sometimes on the desktop.

Advertisware is not a real term, this is to throw you off.

Sellware is a website not a type of software

8 0
3 years ago
Read 2 more answers
The specific term for expediting the delivery of software by breaking a task into smaller increments is called
Ksivusya [100]
Rapid Application Development is the specific term
8 0
3 years ago
Hi can someone help me make a like a song for music Class pls I attached an example of what i need.
g100num [7]

Answer:

i dont really like music so sorry i cant help i hope someone can help you with this.

8 0
3 years ago
Other questions:
  • Please explain external hashing, B-trees, and traversals. 3-5 sentences per
    8·1 answer
  • What is malware short for?
    13·2 answers
  • What are 2 ways that technology can negatively impact the environment.
    8·2 answers
  • Once you select select a crop boundary, you can no
    15·1 answer
  • Which information is considered free for use?
    9·2 answers
  • What is a seismogram?
    9·1 answer
  • To view the results of a query, open it by pressing and holding or right-clicking the query in the navigation pane and tapping o
    10·1 answer
  • Rewritable (write, erase, write again) is known as _______.
    7·1 answer
  • Drag the right word to it’s definition
    13·1 answer
  • Heeeeeeeeeeeeeeeeeeeeeeeeelp pat.2
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!