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

an estimated _____ percent of all college students suffer from ptsd.

Answers

An estimated amount of nine (9) percent of all college students suffers from PTSD.

What is the meaning of Post Traumatic Stress Disorder (PTSD)?

Post-traumatic stress disorder (PTSD) is a mental health disorder caused by experiencing a traumatic incident.

It can emerge after experiencing or witnessing a traumatic incident from symptoms includes from such as:

Flashbacks from accidents or war,Nightmares,Acute anxiety, as well as Uncontrolled thoughts from abuse.

According to statistics, it is estimated that nine (9) percent of all college students suffer from PTSD.

Learn more about Post Traumatic Stress Disorder here:

https://brainly.com/question/13097232

#SPJ12

skill acquisition plans include goals, objectives, ___________________, and data collection.

Answers

Skill acquisition plans include goals, objectives, materials, and data collection.

What is a skill acquisition plan?

A skill acquisition plan can be defined as a written plan that is used to outline the goals, objectives, materials, teaching methods, and data collection techniques for teaching trainees a specific skill or set of skills.

This ultimately implies that, skill acquisition plans include all of the following:

GoalsObjectivesMaterialsData collection

Read more on skill acquisition plans here: https://brainly.com/question/15352575

#SPJ12

If you use a cluster that is managed by a cloud provider, which of these will be managed for you by the cloud provider? *

Answers

When you use a cluster that is managed by a cloud provider, the things that will be managed for you by the cloud provider are:

Monitoring.Networking.Security management task.

What is cloud?

It should be noted that cloud computing are the software that are made available to users through the internet.

When you use a cluster that is managed by a cloud provider, the things that will be managed for you by the cloud provider are monitoring, networking, and security management task.

Learn more about cloud on:

brainly.com/question/9759640

#SPJ12

#SPJ12

algorithm to print the first 10 odd numbers​

Answers

Answer:

I have the code written in c++ but the logic will be the same you just have to change the syntax ( if you're writing different language)

Explanation:

please mark brainliest

What is the principle of operation of the INS?

Answers

The principle of operation of the INS is referred to as dead reckoning.

What is INS?

INS is acronym for Inertial Navigation System and it can be defined as a navigation device that is designed and developed to make use of motion sensors, a computer, and rotation sensors, so as to continuously calculate by dead reckoning the velocity, position, and orientation of an object in motion.

Based on Engineering and Aircraft Avionics, we can infer and logically deduce that the principle of operation of the Inertial Navigation System (INS) is referred to as dead reckoning.

Read more on INS here: https://brainly.com/question/26052911

#SPJ12

The _____ constraint assigns a value to an attribute when a new row is added to a table

Answers

The default constraint gives a value to an attribute when a new row is added to a table.

Is default a kind of constraint?

This is known to be a type of constraint that often apply a value to a column if an INSERT statement does not really give the value for the column.

Therefore, one can say that the default constraint gives a value to an attribute when a new row is added to a table.

Learn more about default constraint from

https://brainly.com/question/19130806

#SPJ12

Sara is asked to create a controller for light sensors. When the light falls on the sensor, it needs to indicate when a particular object is moved from its original position. For this, she needs a credit card-sized motherboard with a microcontroller on it. Which option should she select?

Answers

Answer:

Arduino

Explanation:

Arduino is a free and open-source electronics platform with simple hardware and software. Arduino boards can read inputs, turn on a sensor and transform it into an output, activate a motor, and turn on an LED. Sara may direct her board by sending a series of instructions to the board's microcontroller. To accomplish so, she used the Arduino programming language and the Arduino Software (IDE), both of which are founded on Processing.

assuming the default gateway is connected to the internet, what type of internet access would this server have?

Answers

If the default gateway is connected to the internet, the type of internet access that the server would have is:

Full Access

What is a Default Gateway?

A default gateway is a functionality in a computer system that allows access or communication with other networks.

It is the primary channel of interaction with other networks. Once this default gateway is connected to the internet, it will be given full access.

Learn more about the default gateway here:

https://brainly.com/question/2692918

#SPJ11

________ is a record in a relational database.

Answers

The answer that is a record in a relational database is called; A row

What is a record in relational database?

In relational databases, a record is defined as a group of related data held within the same structure. Furthermore, we can say that a record is a grouping of fields within a table that reference one particular object.

Now, in relational database, a row is called a record because each row, contains a unique instance of data or key for the categories defined by the columns.

Read more about Relational Database at; https://brainly.com/question/13262352

#SPJ12

What are two reasons why a switch port would have a status of errdisable? (choose two. )

Answers

The reasons why a switch port would have a status of errdisable include due to duplex mismatch and bad network interface.

What is a port?

A port simply means a software defined number associated to a network protocol that's transmits communication.

In this case, the reasons why a switch port would have a status of errdisable include due to duplex mismatch and bad network interface.

Learn more about port on:

brainly.com/question/4804932

#SPJ12

to protect a windows 10 system, you've configured system restore to automatically protect your system using restore points. will this adequately protect the user data on the system?

Answers

This can't adequately protect the user data on the system as one needs to enable file history.

How to depict the information?

In order to protect a windows 10 system, one will need to configure the system restore to automatically protect your system using restore points.

Despite this, this can't adequately protect the user data on the system as one needs to enable file history.

Learn more about windows on:

brainly.com/question/25243683

#SPJ12

You are given a string s, in which one letter occurs twice. every other letter occurs at most once. write a function which given a string s returns a single character string the letter that occurs twice

Answers

The program is an illustration of strings.

Strings are variables that are used to hold texts

The main program

The program written in Python, where comments are used to explain each action is as follows:

#This gets the input

s = input()

#This iterates through the text

for i in range(ord('A'), ord('Z') + 1):

   #This converts each character to lower case

   ch rA = c hr(i) . lo wer()

   #This determines the character with two occurrences

   if s.count(chrA) == 2:

       #This prints the character

       print(chrA)

Read more about strings at:

https://brainly.com/question/15683939

#SPJ1

Which is a major drawback of muliuser procesing of a database

Answers

The main drawback of multiuser processing of a database is:

Lost-update problem.

What is  lost-update problem?

In the area of lost update problem, an update that has been carried on to a data item by a transaction is said to be lost as it is known to be overwritten by the update that has been carried on by another transaction.

Therefore, The main drawback of multiuser processing of a database is:

Lost-update problem.

Learn more about database from

https://brainly.com/question/26096799

#SPJ12

webrooming is when consumers physically inspect a product in a store to get a look and feel for it—and then buy it from an online store because it is cheaper to do so. true or false?

Answers

The statement that webrooming is when consumers physically inspect a product in a store to get a look and feel for it—and then buy it from an online store because it is cheaper to do so is false.

What is webrooming?

It should be noted that webrooming simply means the consumer practice for researching products online before buying theme in stores.

In this case, the main idea of webrooming isn't to buy it at stores because it's cheaper. Therefore, it's false.

Learn more about webrooming on:

brainly.com/question/14988432

#SPJ12

when scrum team members meet and collaborate with each other to find the best way to build and deliver the software to the customer, which of the following agile values is being practiced?

Answers

The agile values is being practiced is Individuals and interactions over processes and tools.

What is individuals and interactions over processes and tools?

This is known to be a first value that is seen in the Agile Manifesto as it is “Individuals and interactions over processes and tools.”

Note that it place Value of people more highly instead of processes or tools and as such, The agile values is being practiced is Individuals and interactions over processes and tools.

Learn more about  scrum team  from

https://brainly.com/question/4763588

#SPJ11

7.7% complete Question An aviation tracking system maintains flight records for equipment and personnel. The system is a critical command and control system that must maintain a global availability rate of 99%. The entire system is on a cloud platform that guarantees a failover to multiple zones within a region. In addition to the multi-zonal cloud failover, what other solution would provide the best option to restoring data and rebuilding systems if the primary cloud service becomes unavailable

Answers

The solution that would provide the best option to restoring data and rebuilding systems if the primary cloud service becomes unavailable is offline.

What is data?

It should be noted that data simply means the representation of facts ans concepts on a formalized manner.

In this case, the solution that would provide the best option to restoring data and rebuilding systems if the primary cloud service becomes unavailable is offline.

Learn more about data on:

brainly.com/question/4219149

#SPJ12

Which of the following is NOT a career in the Information Support and Services pathway?

a
Website engineers
b
Technical writers and editors
c
Database administrators
d
Software developers

Answers

Answer:

here yuuuurrrrr Vote for me nah jk

ram is ________ and has no moving parts.

Answers

RAM is Electronic (solid state) and has no moving parts.

What is a RAM in computer?

RAM is known to be an random-access memory as it is said to be a short term memory and it is the place where data is saved as the time the processor requires for it.

Note that RAM is Electronic (solid state) and has no moving parts as it is often inbuilt in a computer system.

Learn more about RAM From

https://brainly.com/question/13196228

#SPJ11

Write a statement that toggles the value of onoffswitch. That is, if onoffswitch is false, its value is changed to true; if onoffswitch is true, its value is changed to false.

Answers

Answer:

import java.io.*;

public class OnOffSwitch

{

public static void main(String[] args)

{

boolean onoffswitch = false;

String value = "false";

if (onoffswitch)

 {

   value = "true";

   onoffswitch = true;

 }

else

{

  value = "false";

   onoffswitch = false;

}

//

System.out.println(value);

}

}

Explanation:

Basically, the simple java program looks through the boolean state and checks, if the boolean value is true, then change the value, otherwise retain the value as default.

The straightforward Java application scans the boolean state and determines whether the value should be changed if it is true, or left alone if it is false.

To toggle the value of the onoffswitch variable, you can use a simple assignment statement along with the logical negation operator (!).

Here's the statement:

onoffswitch = !onoffswitch;

In this statement, the value of onoffswitch is negated using the ! operator. If onoffswitch is currently false, applying the logical negation will change it to true.

On the other hand, if onoffswitch is currently true, the negation will change it to false.

This way, the value of onoffswitch is toggled between true and false based on its current state.

By assigning the negated value back to onoffswitch, you effectively update its value to the toggled state.

Learn more about Coding click;

https://brainly.com/question/17204194

#SPJ6

hexadecimal to denary gcse method

Answers

There are two ways to convert from hexadecimal to denary gcse method. They are:

Conversion from hex to denary via binary.The use of base 16 place-value columns.

How is the conversion done?

In Conversion from hex to denary via binary:

One has to Separate the hex digits to be able to know or find its equivalent in binary, and then the person will then put them back together.

Example - Find out the denary value of hex value 2D.

It will be:

2 = 0010

D = 1101

Put them them together and then you will have:

00101101

Which is known to be:

0 *128 + 0 * 64 + 1 *32 + 0 * 16 + 1 *8 + 1 *4 + 0 *2 + 1 *1

= 45 in denary form.

Learn more about hexadecimal from

https://brainly.com/question/11109762

#SPJ1

Which command helps verify the cisco ios ips configuration?

Answers

Router# show IP IPS configuration is a command which can be used to verify the Cisco IOS IPS configuration.

What is a command?

A command can be defined as the set of instructions that is used to configure a network device such as a router, so as to make it active on a computer network and enable it perform certain tasks automatically during network communication.

In this scenario, Router# show IP IPS configuration is a command which can be used to verify the Cisco IOS IPS configuration.

Read more on commands here: brainly.com/question/17147683

#SPJ12

The online promotional method that involves applying specific Web design and development techniques to Web pages to increase the possibility that the pages will appear near the top of a search results list is called ____.

Answers

Answer:

Search Engine Optimization (SEO)

Explanation:

SEO, or search engine optimization, is a critical online marketing approach that entails getting your website and business accessible in search engines. Ultimately, SEO is a catch-all phrase for any approach used to boost your website's ranking in search results for keywords related to your business.

Identifying what consumers look for online, the phrases or terminology they use, and the sorts of material they want to consume are key components of any search engine optimization plan. When done effectively, SEO helps marketers to reach and engage with individuals who are looking for the products and services that their company provides.

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

When a cookie is created during a website visit, it is stored:

Answers

When a cookie is created during a website visit, it is stored on the hard drive if the visitor's computer.

What is a cookie?

A cookie simply means the small blocks of data that are created by a web server.

In this case, when a cookie is created during a website visit, it is stored on the hard drive if the visitor's computer.

Learn more about cookie on:

brainly.com/question/1308950

#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.

Which two cisco products are equipped with the integrated connector to the cisco cws service? (choose two. )

Answers

The cisco products that are equipped with the integrated connector to the cisco cws service include Cisco ESA and Cisco WSA.

What is an integrated connector?

It should be noted that an integrated connector are the components that are offered to connect with applications and data sources.

In this case, the cisco products that are equipped with the integrated connector to the cisco cws service include Cisco ESA and Cisco WSA.

Learn more about integrated connection on:

brainly.com/question/24196479

#SPJ12

30 POINTS FOR THE CORRECT ANSWER
Now that you have a solid understanding of the history, principles, elements, typography, and colors used in graphic and web design, what do you think is the most critical part of creating a design that gets the right response from your target audience? Your answer must include your thoughts on what part is most important, why it is most important, and an explanation of how you would go about creating a design based on your choice. Your answer must mention and be supported with information from each of the lessons in the unit.

Answers

Answer:

Whether it’s on our phones, in books or on websites, we’re constantly digesting written words. From instruction booklets to shop fronts, type is all around us. We often reflect on the power of the written word, but rarely do we consider the designer’s role in emulating the tone of the word or sentence.

Behind the scenes, a designer has taken the time to consider the relationship between the look of the text and what the text says. In reality, different moods, atmospheres and emotions can be expressed simply through the type choice. But what actually is typography—and why is it so vital?

In this article, we’ll lift the lid on everything you need to know about typography. We’ll start with the definition of typography, including a brief history of its origins. We’ll then address the benefits of good typography and the impact it can have on your users. Finally, we’ll look into the different elements that comprise typography, and what they all mean.

Here’s what we’ll cover:

What is typography?

Why is typography important?

The different elements of typography

How to choose the correct typeface for your website

Conclusion

which is a guideline for conducting technical reviews?

Answers

A guideline for conducting technical reviews is to be sure team members have identical skillsets.

What is Technical review?

Technical review is a term that connote the application of scientific, engineering, or other form of expertise to know if activity for which a permit is requested attain the standards for giving the permit under the required statute and rule.

Therefore, A guideline for conducting technical reviews is to be sure team members have identical skillsets.

See options below

Which is a guideline for conducting technical reviews?

be sure team members have identical skillsets

involve people from different backgrounds

omit domain experts on the review team

Learn more about guideline from

https://brainly.com/question/17711902

#SPJ11

A web search engine is a that helps you locate on the web.

Answers

A web search engine is a software which helps you locate on the web.

A web search engine is a software that searches the web  for information is known as a web search engine. A user query's search results are frequently presented as a list. Web pages, pictures, and other file kinds could be included in the lists.

some major search engines are  Yahoo , Bing etc

Learn more about search engine here:

https://brainly.com/question/20850124

#SPJ10

In what type of attack does the adversary leverage a position on a guest operating system to gain access to hardware resources assigned to other operating systems running in the same hardware environment

Answers

Answer:

VM escape attack

Explanation:

In a VM escape attack, the attacker exploits hypervisor vulnerabilities to gain control over resources reserved for other guest operating systems. Services operating on the guest may be exposed to the other attacks, but such attacks can only access data allotted to the same guest. In the event of a buffer overflow or directory traversal or the client in the case of cross-site scripting.

Other Questions
can somebody please answer correctly i will give brainlist? what is the mood in the story money least of his worries a supermarket display consists of boxes of cereal. the bottom row has 23 boxes. each row has three fewer boxes than the row below it. the display has six rows. What is the impact Then and Today of Upton Sinclair's reforms? please answer this! (from khan academy 6th grade math) Sample Response: James Baldwin speeds up the action to create suspense for the reader. By moving the action forward so quickly, the author leaves the reader anxious to discover if Theseus saves himself and the other characters from the Minotaur.What did you discuss in your response? Check all that apply.speeding up the actioncausing the reader to be more interestedsequencing events to create suspensemaking readers curious about the outcomeplacing the characters in a dire setting Leading up to Revolution Fill in this timeline of events leading up to the American Revolution using the information from the lesson. In the middle column,describe the event. In the third columan, explain the reaction of colonists to each event. NEED HELP ASAP 1 HOUR LEFT Choose the best Spanish word to complete the sentence.Ellos _____________ unos dibujos.imprimieronimprimimprimisteimprimimos (x) = x - x - 1What is the average rate of change of f overthe interval -1 x 1? Lysis is best described as: A. When a cell takes in too much water from Osmosis, swells, and bursts. B. When a cell loses too much water from Osmosis, and shrinks. C. The balance of concentration inside and outside of the cell. D. The production of energy in the cell. the management of sondela limited has decided to prepare a cash budget for may and june 20x8 Solve the equation.7h-5(3h-8)= -72 PLEASEEEEEE HELPPPPPPP!!! 50 POINTSSSSSS12 = 6^2 + 7^2 - 2 (6) (7) (cosA)solve for the cosA Supporters of a minimum wage argue that it can increase wage rates without causing significant unemployment in which type of labor market? The radius of a circle is 4 millimeters. What is the circle's area? Use 3.14 for pi.(The answer MUST BE ONE OF THE ANSWERS BELOW) In the reaction below, 1.000 103 g LiOH is combined with 8.80 102 g CO2. The reaction produces 3.25 102 g H2O in an experiment.CO2 + 2LiOH Li2CO3 + H2O theoretical yield Type the correct answer in each box. Use numerals instead of words. If necessary, use / for the fraction bar(s). The complexity and challenges associated with planning for and executing an operation include. how is grapiprant absorbed + secreted?