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
Write an algorithm to display your name 10 times​
Tasya [4]

Hey this code was made in java if you have any issues let me know

package nametest;

public class Nametest {

   

   public static void main(String[] args) {

       System.out.println("namehere");

        System.out.println("namehere");

         System.out.println("namehere");

          System.out.println("namehere");

           System.out.println("namehere");

            System.out.println("namehere");

             System.out.println("namehere");

              System.out.println("namehere");

               System.out.println("namehere");

                System.out.println("namehere");

       

   }

   

}

Hope it helps

-scav

4 0
3 years ago
Effective presentations vary the color scheme on each slide.<br><br> True<br> False
KengaRu [80]

Answer:

TRUE

Explanation:

7 0
3 years ago
Read 2 more answers
PLEASE HELP
Zinaida [17]

Answer:

B from you search question carefully and identify the key word

Explanation:

3 0
3 years ago
Read 2 more answers
Which cloud technology characteristic ensures that a cloud customer can make changes to her cloud database from her smartphone w
Setler79 [48]

The cloud technology characteristic that ensures that a cloud customer can make changes to her cloud database from her smartphone is Broad network access.

<h3>What is the network about?</h3>

Broad network access is known to be a feature of cloud computing as it is seen as  the ability of network tools to be able to link with a large scope or variety of devices.

Note that The cloud technology characteristic that ensures that a cloud customer can make changes to her cloud database from her smartphone is Broad network access.

Learn more about cloud technology from

brainly.com/question/19057393

#SPJ1

5 0
2 years ago
To bundle links together in order to improve bandwidth availability and redundancy, what protocol is used
Daniel [21]

Answer:

Link Aggregation Control Protocol

Explanation:

Link Aggregation Control Protocol can be used to assist in the formation of port channel bundles of physical links.

Link Aggregation Control Protocol is an IEEE standard defined in IEEE 802.3ad. LACP lets devices send Link Aggregation Control Protocol Data Units (LACPDUs) to each other to establish a link aggregation connection.

8 0
3 years ago
Other questions:
  • Which social media marketing concept engages visitors, getting them to revisit your website and tying them to offline events for
    7·2 answers
  • External hard disks use different technology than internal hard disks. ture or false
    6·1 answer
  • Which of the following tends to be true of silent film acting as opposed to sound film acting?
    7·1 answer
  • Whats the difference between copying a file to my desktop and creating a shortcut?
    8·1 answer
  • Microsoft ________ is a cloud storage and file sharing service
    12·1 answer
  • Dorothy needs to edit JPEG and GIF files in a multimedia application. Which software can Dorothy use to edit these files?
    8·2 answers
  • How does it transform your ways of socializing
    11·1 answer
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    8·1 answer
  • Suppose the cache access time is 10ns, main memory access time is 200ns, and the cache hit rate is 90%. Assuming parallel (overl
    10·1 answer
  • The internet is controlled by ______
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!