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

Answers

Answer 1

The toll program illustrates the use of conditional statements;

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

The toll program

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:

https://brainly.com/question/24833629

#SPJ1


Related Questions

Bios or uefi allow you to configure, enable, and disable the _____ that are bound to the motherboard

Answers

Answer:

devices

Explanation:

BIOS and UEFI are two computer firmware protocols that act as an interpreter between the operating system and the computer firmware. Both of these interfaces are used at computer launch to setup hardware components and launch the operating system stored on the hard drive.

BIOS or uefi allow you to configure, enable, and disable the devices that are bound to the motherboard.

What is BIOS in motherboard?

BIOS is known to be the (basic input/output system)  and it is a program of the computer's microprocessor that often helps to start the computer system after it is said to be powered on.

Note also that BIOS or uefi allow you to configure, enable, and disable the devices that are bound to the motherboard.

Learn more about BIOS from

https://brainly.com/question/13103092

#SPJ12

In a certificate authority (ca) infrastructure, why is a client certificate used?

Answers

Answer:

To authenticate the client with other computers, a client certificate is utilized. For component of the permissions before starting an encrypted channel, the client utilizes the CA certificate to validate the CA signature on the server certificate. Client software is often used. Web pages, for example, offer a list of trustworthy CA certificates, since  many users rely on their client software.

The client certificate that is used as part of the authorizations before launching a secure connection.

What is a client certificate?

A client certificate is a form of digital certificate that is used to make authenticated request to a remote server.

In this case, the client certificate is used as part of the authorizations before launching a secure connection.

Learn more about certificate on:

brainly.com/question/24931496

#SPJ12

“ How To “ Speeches and on research findings are two examples of _______ speeches.

Answers

Answer:

Informative

Explanation:

What term is used to describe selecting and viewing information in a database?

Answers

Answer:

Query

Explanation:

A query is a request for information that causes a database to be searched for the requested information. A set of pre-defined codes must be used when writing a query so that the database can interpret the request. A database requests information from another database. The query should be made in a database table or group of tables using the query language, a type of programming language. In this manner, the system is able to comprehend and handle the query appropriately.

A terminology which is used to describe selecting and viewing information stored in a database is known as query.

What is query?

A query can be defined as a computational request, selection and view of the data that are stored in a database table, from existing queries, or even from a combination of both a database table and existing queries.

In this scenario, we can infer and logically conclude that query is a terminology that is typically used to describe selecting and viewing of information that are stored in a database.

Read more on query here: https://brainly.com/question/25266787

#SPJ12

Which printer management components would you use to view the port a printer uses? (select two. )

Answers

The printer management components one would use to view the port a printer uses are as follows;

Printer propertiesPrinter server properties

What is Printer management components?

The print management component provides a single interface where a user can open the print management utility and view all printers and print servers in the enterprise.

The port of a printer is the connector usually on the computer that allow communication with the printer.

Therefore, the printer management components one would use to view the port a printer uses are as follows;

Printer propertiesPrinter server properties

learn more on printers port here: https://brainly.com/question/17157651

#SPJ12

As you are working with a pivot table, you decide to change some of your source data. How will the pivot table recognize the change?.

Answers

You will either click refresh on the analyze ribbon or click Alt+ f5.

An effective tool for calculating, condensing, and analyzing data that enables you to spot comparisons, patterns, and trends in your data is the pivot table.

Manually Update a PivotTable

Make a change to the PivotTable's source data.Navigate to the PivotTable.Click any cell inside the PivotTable. The PivotTable Tools are displayed on the ribbon.Click the Analyze tab on the ribbon.Click the Refresh button. Alt + F5 also refreshes the PivotTable.

Tip: To update all PivotTables in your workbook at once, click Analyze > Refresh All.

learn more about PivotTable here: https://brainly.com/question/27813971

#SPJ10

When there is a missing DLL file, _______.
A. Hard drive needs to be scanned
B. the computer will display error messages
C. Applications might run slowly

Answers

Answer:

B. the computer will display error messages

When there is a missing DLL file, the computer will display error messages. The correct option is B.

What is a DLL file?

DLL is dynamic link library is a concept of Microsoft implementation of the shared library concept of Microsoft Windows. This library contains codes and data that can be use in making a program.

Thus, the correct option is B. the computer will display error messages.

Learn more about a DLL file

https://brainly.com/question/23551323

#SPJ1

Mr. Gomez notes that a Private Fee-for-Service (PFFS) plan available in his area has an attractive premium. He wants to know if he must use doctors in a network as his current HMO plan requires him to do. What should you tell him

Answers

The thing that he will be told is that he may receive healthcare services from any doctor allowed to bill Medicare.

What is Medicare?

Medicare simply means a government national health insurance program in the United States.

In this case, the thing that he will be told is that he may receive healthcare services from any doctor allowed to bill Medicare.

Learn more about Medicare on:

brainly.com/question/15074045

#SPJ12

Viruses that load from usb drives left connected to computers when computers are turned on are known as.

Answers

Answer:

Viruses that load from USB drives left connected to computers when computers are turned on are known as boot sector viruses

Explanation:

Software designed to close logical ports in your computer is know as firewall Which is NOT a tool hackers use to gain access to and take control of your computer

What is the most common way to obtain new software?.

Answers

Today, the most common way to get new software is to download it from the Internet. Applications like Microsoft Office and Adobe Photoshop can now be purchased and downloaded right to your computer. You can also install free software this way.

Enterprise software includes a database and thousands of predefined​ ________________.

Answers

Answer:

Business processes. Hope it helps!

What is difference between barcode reader and finger print reader

Answers

Answer:

they are different bc finger printe reader reads when someone one prints it for them

what type of storage drive contains multiple spinning platters?

Answers

The type of storage drive that contains multiple spinning platters is called; Hard disk drives

What is the hard disk drive?

A computer hard disk drive (HDD) is a non-volatile data storage device. Non-volatile refers to storage devices that maintain stored data when turned off.

Now, the correct answer to the question is hard disk drives. This is because a hard disk drive is comprised of a stack of spinning metal disks known as platters. Each spinning disk has trillions of tiny fragments that could possibly be magnetized in order to represent bits (1s and 0s in binary code).

Read more about Hard disk drives at; https://brainly.com/question/24498473

#SPJ12

what is one of the key components of a typical formula?

Answers

The key components of a typical formula?

FunctionsReferencesOperatorsConstants.

What is a formula?

A formula is known to be made up of functions, references, operators, and constants as they help it to carryout its operations.

A function is known to be any rule, or expression that tells about an association between one variable and other.

Therefore, The key components of a typical formula?

FunctionsReferencesOperatorsConstants.

Learn more formula from

https://brainly.com/question/2005046

#SPJ11

in the active directory, what is the topmost level?

Answers

Note that in the active directory, the Forest is known to be the topmost level.

What is highest level in an Active Directory design?

An Active Directory forest is known to be the biggest level of organization that is found in the Active Directory as all of the forest often shares a single database.

Note therefore, that in the active directory, the Forest is known to be the topmost level.

Learn more about  active directory from

https://brainly.com/question/14364696

#SPJ11

the scope of a temporary table is limited to what?

Answers

The scope of a temporary table is limited to the database session in which it's defined.

What is a database?

A database can be defined as an organized and structured collection of data that are stored on a computer system as a backup and are usually accessed electronically.

In database management system (DBMS), the scope of a temporary table is generally limited to the database session in which it's defined by a software developer or programmer.

Read more on database here: brainly.com/question/13179611

#SPJ12

What is the primary motivation of the ""cyber warrior""?

Answers

The primary motivation of the ""cyber warrior"" is to defend computer and information systems, or also to attack the system.

Who is a  cyber-warrior?

This is known to be a person that is said to be involved in cyberwarfare, mostly for personal reasons or based on religious belief or others,

Note that The primary motivation of the ""cyber warrior"" is to defend computer and information systems, or also to attack the system.

Learn more about cyber warrior from

https://brainly.com/question/1460915

#SPJ12

whts the mistake in this
pls do help me out

Answers

Explanation:

i don't even know it's uclear what the mistake is

after input is finished, another call to read would return which of the following to indicate that the end of the file has been reached?

Answers

After input is finished, another call to read would return an empty string to indicate that the end of the file has been reached.

What is data read from a file?

When data is said to read from a file, it is said to fully or automatically saves itself in a variable. Note that If a file is said to already exists, one can open it.

Note that After input is finished, another call to read would return an empty string to indicate that the end of the file has been reached.

Learn more about input from

https://brainly.com/question/5451281

#SPJ11

What is being done to reduce the python population in florida?.

Answers

florida man eats the snake for breakfast

what type of e-mail typically lures users to sites or asks for sensitive information?

Answers

The  type of e-mail typically lures users to sites or asks for sensitive information is phishing.

What is a phishing email?

Phishing is a type of internet scam where cyber hackers impersonate legitimate organizations via email, text message, advertisement or other means in order to steal sensitive information.

This criminals usually send an email link mimicking the company .

The aim of the email is to get sensitive information in order to access your funds or private information.

learn more on phishing email here: https://brainly.com/question/14954901

#SPJ11

What is boot sector virus​

Answers

Answer:

Boot Sector virus is when a virus infects the Boot Sector of a hard disk. A Boot Sector is the initial files necessary to start an OS and other bootable programs. It is typically infected by these viruses when started with infected floppy disks, however the boot virus does not have to be successful to infect your computer. Once infected, the virus tries to infect every other disk.

Hope this helps!

explain stress management give a suitable example to explain how it is important.

Answers

Answer:

Hopefully This Will Help :)

Explanation:

Put simply, stress management is: “set of techniques and programs intended to help people deal more effectively with stress in their lives by analyzing the specific stressors and taking positive actions to minimize their effects”. Popular examples of stress management include meditation, yoga, and exercise.

A systems engineer is managing a server cluster. A memory fault has occurred in one of the active servers; the cluster software has caused another server in the cluster to become active. The system engineer has witnessed a:

Answers

In the case above, The system engineer has witnessed a Failover.

What is the use of Server cluster?

This is known to be a tool that makes a website to be able to run smoothly and it gives little glitches and a better user experience.

Therefore, In the case above, The system engineer has witnessed a Failover.

See full question below

A systems engineer is managing a server cluster. A memory fault has occurred in one of the active servers; the cluster software has caused another server in the cluster to become active. The system engineer has witnessed a:

a. Pairing

b. Failover

c. Load balance

d. Synchronization

Learn more about  cluster software from

https://brainly.com/question/2749543

#SPJ1

In the certificate authority trust model known as a hierarchy, where does trust start?

Answers

In the certificate authority trust model known as a hierarchy, the trust start from Root CA.

What does a certificate authority do?

A certificate authority (CA) is known to be a kind of a trusted body that is known to often issues Secure Sockets Layer (SSL) certificates.

Note that In the certificate authority trust model known as a hierarchy, the trust start from Root CA as that is its beginning point.

Learn more about  certificate authority from

https://brainly.com/question/17011621

#SPJ12

write the icon of full justification​

Answers

Answer:

In the paragraph group, click the Dialog box Launcher. ,and select the Alignment drop - down menu to set your justified text. You can also use the keyboard shortcut , Ctrl + J to justify your text

What three application layer protocols are part of the tcp/ip protocol suite?

Answers

The three application layer protocols that are part of the TCP/IP protocol suite are:

DNSDHCPFTP

What is the TCP/IP protocol suite?

The TCP/IP protocol suite is an abbreviation for Transmission Control Protocol and Internet Protocol and it can be defined as a standard framework for the transmission (prepare and forward) of information on digital computers over the Internet.

In the Transmission Control Protocol and Internet Protocol (TCP/IP) model, the three application layer protocols include the following:

DNSDHCPFTP

Read more on TCP here: https://brainly.com/question/17387945

#SPJ12

The it components of an erp system architecture include the hardware, software and the ________

Answers

The components of an ERP system architecture is made up of the hardware, software and the Data.

What is an ERP system?

Enterprise resource planning (ERP) is known to be a kind of  software that firms often use to handle or manage day-to-day business works such as accounting and others.

Note that The components of an ERP system architecture is made up of the hardware, software and the Data.

Learn more about  ERP system from

https://brainly.com/question/14635097

#SPJ12

C. What is windows operating system? Compare different versions of operating system after 2003

Answers

Answer:

:)

Explanation:

The Windows operating system (Windows OS) refers to a family of operating systems developed by Microsoft Corporation. We look at the history of Windows OS from 1985 to present day.

The Windows operating system (Windows OS) for desktop PCs is more formally called Microsoft Windows and is actually a family of operating systems for personal computers. Windows has traditionally dominated the personal computer world, running, by some estimates, more than 75 percent of all personal computers. Beginning in the early 2000s, Windows dominance has lessened with the growth of the Linux and Mac operating systems.

Windows provides a graphical user interface (GUI), virtual memory management, multitasking, and support for many peripheral devices. In addition to Windows operating systems for personal computers, Microsoft also offers operating systems for servers and mobile devices.

Windows is also the foundation for the Microsoft Office productivity suite. Introduced in 1990 as a Windows-only family of applications for desktop computers, Office has grown to become the world’s most widely used productivity suite, with windowscentral.com reporting an estimated 1.2 billion + user worldwide as of 2016.

how do you determine if a name is a variable holding a value or if it is a function call?

Answers

The way to determine if a name is a variable holding a value or if it is a function call is by:

Instance variables are prefixed with self.

What is this call about?

A function call is known to be a kind of an expression that has the function name which is said to be accompanied by the function call operator, () .

Note that The way to determine if a name is a variable holding a value or if it is a function call is by:

Instance variables are prefixed with self.

See full question below

How do you determine if a variable in a method is an instance variable for the class?

a) Instance variables have leading underscores in their names.

b) Instance variables are prefixed with self..

c) Instance variables start with a capital letter.

d) all of the above

e) none of the above

Learn more about function call from

https://brainly.com/question/15071685

#SPJ11

Other Questions
The underlined sentence is- A. a piece of evidence for the texts argument B. The thesis statement for the textC. A piece of reasoning in the textD. The conclusion of the text __________________________It connects ideas in the text by- A. Relating a fact or story that demonstrates the texts argument B. Making the main claim of the textC. Suggesting how a specific example relates to the broader argument D. Describing why the information provided matters to the readers If the mortgage loan is 80% of the appraised value of a house, and the interest rate of 8% amounts to $460 interest for the first month, then what is the appraised value of the house? Monomal by a DinormalWhat is the product of x(x + 1)?O 2x+x0x2+2x022 +1O x + xwill give brainliest Of protons, neutrons, and electrons, the least massive particle is the electron.is it True or False Hey there - Describe about French revolution. On a coordinate plane, 2 exponential functions are shown. f (x) decreases from quadrant 2 to quadrant 1 and approaches y = 0. It crosses the y-axis at (0, 4) and goes through (1, 2). g (x) increases from quadrant 3 into quadrant 4 and approaches y = 0. It crosses the y-axis at (0, negative 4) and goes through (1, negative 2).Which function represents g(x), a reflection of f(x) = 4(one-half) Superscript x across the x-axis?g(x) = 4(2)xg(x) = 4(2)xg(x) = 4(one-half) Superscript xg(x) = 4(one-half) Superscript negative x Hull fouling is a(n) _______ introduction of nonnative species. a. unintentional b. intentional c. unimportant d. land-based please select the best answer from the choices provided a b c d Find the measure of x.42X17x= [ ?Round to the nearest hundredth. What is the measure of an exterior angle of a regular hexagon?3601803060 The population of a large city can be calculated using the function P=345,000(1.01). What can you say about the rate of change from year 1 to year 2 compared to the rate of change from year 9 to year 10? A medical assistant is answering the clinic phone. Which of the following guidelines demonstrates professional telephone etiquette? what causes the hidden node problem in a wireless local area network (wlan)? Which equations are true for x = -2 and x = 2? Select two optionsA x-4=0B x=-4B 3x + 12 = 0C 4x = 16D 2(x-2) = 0 If you receive a 30% DISCOUNT off an item costing $60.00, how much money do you save? A government authority or license excluding others from making, using, orselling an invention without the creator's permission is called aO A. patentOB. Copyright O c. trademarkOD. trade secret giving 20 points out for this question! After the aed delivers a shock, what is your next step? begin cpr compressions deliver another shock do nothing remove the aed pads Solve for x.Use the quadratic formula.2x - 9x + 8 =0 Linda needs 2/5 of an ounce of salt to make 1 cup of dip for her fries. How many cups of dip will she be able to make if she has 40 ounces of salt? Which expression is equivalent to 3x^-6y^-3 / 15x^2y^10? Assume x 0, y 0