Toll gates have different fees based on the time of day, weekdays/weekends. Write a function that has three parameters: the current hour of time (int), 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)input : toll_fee(8, True, False) Output : $ 2.95

Answers

Answer 1

The program is an illustration of functions

What are functions?

Functions are named program statements that are executed when called

The actual program

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

#This defines the function

def toll_fee(time,weekday,weekend):

   #This determines the toll fee for weekdays

   if(weekday):

       if time < 7:

           return 1.15

       elif time>=7 and time <10:

           return 2.95

       elif time>=10 and time <15:

           return 1.90

       elif time>=15 and time <20:

           return 3.95

       else:

           return 1.40

   #This determines the toll fee for weekends

   elif(weekend):

       if time < 7:

           return 1.05

       elif time>=7 and time <20:

           return 2.15

       else:

           return 1.10

#This calls the toll fee function        

print(toll_fee(8, True, False))

Read more about functions at:

https://brainly.com/question/16397886


Related Questions

A popular game allows for in-app purchases to acquire extra lives in the game. When a player purchases the extra lives, the number of lives is written to a configuration file on the gamer's phone. A hacker loves the game but hates having to buy lives all the time, so they developed an exploit that allows a player to purchase 1 life for $0.99 and then modifies the content of the configuration file to claim 100 lives were purchased before the application reading the number of lives purchased from the file. Which of the following type of vulnerabilities did the hacker exploit?
a. Sensitive data exposure.
b. Dereferencing.
​c. Broken authentication.
​d. Race condition.

Answers

Based on the fact that the hacker's actions are done before the application reading of the lives purchased, this is d. Race condition.

What is a race condition?

This is when certain processes in an application depend on the timing of a a previous process or event. The flow of information can then be intercepted before the process completes.

This is what the hacker did here by accessing the application to change the number of lives purchased before the application read the number of lives purchased.

In conclusion, option D is correct.

Find out more on the race condition at https://brainly.com/question/13445523.

Legends are titles given to three-axis X, Y, and Z-axis. True or false?

Answers

Answer:

true the legends are the names on each side of the chart that show what the chart shows

true

Hope This Helps!!!

Brainy users come back and answer some questions some of us really need help get your ponits today and you will feel good mean while you answer questions other people might have.!

Answers

Answer:

of course we will answer any question at any time

Complete the sentence.
Accessibility benefits______

• everyone
• people with impairments

The goal of accessibility is to provide_________

• access for as many people as possible
• access for 100 percent of users


Answers

Answer:

Complete the sentence.

Accessibility benefits______

• everyone

• people with impairments✔

The goal of accessibility is to provide_________

• access for as many people as possible✔

• access for 100 percent of users

I put a tick in the answer

Answer:

people with impaired,

access for as many people as possible

Explanation:

for what work photoshop is used?

Answers

its for making commercials and background that look cool
Adobe Photoshop is a software used for editing photographs, compositing digital art, animating, and graphic design

Which of the following can be used to enter or display one complete row of information in a range or table
without scrolling horizontally?

Answers

Answer:

A. Create

Explanation:

I just took the test for Microsoft Access the answer to Which of the following can be used to enter or display one complete row of information in a range or table without scrolling horizontally? is Create

The one that can be employed to show an entire row containing information in a table would:

Data Form

What is Data Form?

The data form is described as the source in Microsoft Excel that offers the user an option to either enter or show a whole row having details or information without even scrolling the cursor west to east or horizontally.

This option has made the data editing very convenient and quick for the users and made the process more effective and efficient.

This is very useful with this option as one can continue data entry more easily as it helps in keeping records more quickly.

Thus, the above response is correct.

Learn more about "Table" here:

brainly.com/question/14231889

Explain the importance of electronics on our daily lives”? 5 sentences minimum

Answers

Answer:

through electronics we have a electrified lighted world. our homes,are lit with light using electricity. the stereo we listen to, electricity makes it happen. tv,computers, and record turntables all need electricity. electricity makes things possible that would otherwise be either impossible or very arduous. we see sounds and enjoy them. we watch entertaining movies. we read books and do our homework with the appreciated help of electricity.





Why are volt guards necessary to connect with the computer? .:​

Answers

It prevents our computer system against sudden power surge. ... As we have known that our computer needs voltage between 220 to 240 volts and high or low voltage affects our computer, Volt Guard plays important role to save our computer system from damage due to high voltage.

10. What is the value of favorite Animal after the code below is run?
animals = [ 'dog', 'cat', 'cow', 'pig' ]
favoriteAnimal = animals[2]
[1 point]
O a. dog
O b.cat
O c. cow
O d. pig

Answers

Running the code

animals = [ 'dog', 'cat', 'cow', 'pig' ]

favoriteAnimal = animals[2]

will give a result of

"cow"

In a 100m sprint, identify some of the phases that you would see the athlete complete?

Answers

Answer:

in a 100m sprint identify some of the phases

HELP URGENT
When programming, which of the following is true of the editor? A. It is a person who checks your work for spelling errors. B. It is where you write your program and run it. C. It is a coding language. D. It is a program that checks for grammatical errors.

Answers

Answer:

D. It is a program that checks for grammatical errors.

Which of the following can be used to enter or display one complete row of information in a range or table
without scrolling horizontally?

Answers

End users can use database tools to enter or display one complete row of information in a range or table on Microsoft Excel without scrolling horizontally.

What is Microsoft Excel?

Microsoft Excel can be defined as a software application that was designed and developed by Microsoft Inc., for analyzing and displaying (visualizing) spreadsheet documents by using rows and columns in a tabulated format.

In Microsoft Excel, end users can use database tools to enter or display one complete row of information in a range or table on Microsoft Excel without scrolling horizontally. Some examples of these database tools include:

PivotTablesExcel Tables

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

what is the salary for an average software dev?

Answers

Answer:

$73,213

Explanation:

Answer:

500

Explanation:

maybe ldk I'm not a electronic seller

Create a list that will contain 14 elements, with the first 12 elements having the value “badger” and the last two elements having the value “mushroom”.

Answers

A list that contains 14 elements, with the first 12 elements having the value “badger” and the last two elements having the value “mushroom” is as follows:

list1 = ["badger", "badger", "badger", "badger", "badger", "badger", "badger", "badger", "badger", "badger", "badger", "badger", "mushroom" "mushroom"]

Code explanation

List are used to store multiple items in a variable. The items stored accommodate different datatype. List are represented with a square bracket "[]". The elements stored are placed inside the square brackets.

The python list is stored in the variable list1The python list has the first 12 elements as "badger" and the last two elements as "mushroom".

learn more on list here: https://brainly.com/question/24941798

While you are using some files on a workstation running Linux, you determine that a few of the files seem to be corrupted. What should you do

Answers

The best thing to do is to close all files and applications and run fsck.

What is an Application?

This is defined as a computer program designed to carry out a specific task and is used by end-users.

When few files seem to be corrupted, it is best to close all applications and run fsck command as it helps to check and interactively repairs inconsistent file systems.

Read more about Corrupted files here https://brainly.com/question/2596545

Answer all the questions correcty and the first answer get to be marked brainliest!!!!!!
1. ___________________ is a sort of advertisement that disturbs your Web browser by
appearing in a separate window on the top of your current window.
2. The ____________________ is a quick and easy way to create new objects in MS
Access.
3. _________________ present data from tables and queries in an attractive format.
4. . A __________________ is a column in a table that contains a specific piece of
information within a record.
5. What is the storage capacity of a free Picasa account?
6. What displays the current record number and navigate to other records?
7. Name any five tools present in MS Access Window.
Need it now!!!

Answers

allowed public advertisement

opening a new database

column format

database record

1gb

the navigation button will show the current record and the correct no.

table,querie,relatinship,macros,forms

Which type of shape allows you to add text that can be moved around.

Answers

Answer:

Move a text box, WordArt, or shape forward or backward in a stack. Click the WordArt, shape, or text box that you want to move up or down in the stack. On the Drawing Tools Format tab, click either Bring Forward or Send Backward.

Explain why not having a driver for the old printer is a problem​

Answers

Answer:

Because you won't be able to print anything without it, because there would be no connection to the printer

What information most likely presents a security risk on your personal social networking profile?.

Answers

Answer:

Your personal social networking profile may pose security risks if you post certain information publicly. Individuals' Personally Identifiable Information (PII) or Protected Health Information (PHI) is considered to be PHI.

Explanation:

hope this helps!!!!!

The information that is most likely presents a security risk on your personal social networking profile is birthday and hometown. The correct option is B.

Your birthday and hometown are the two pieces of information on your personal social networking page that most likely pose a security issue. Malicious persons may use this information to pose as you or obtain unauthorised access to your accounts.

Through identity theft or phishing scams, attackers may try to use your birthdate to access sensitive information about you, like your social security number or account passwords.

Your online accounts could be compromised if someone uses information about your hometown to crack passwords or figure out security questions.

To safeguard your privacy and improve your online security, you should exercise caution while disclosing such sensitive personal information on social media networks.

Thus, the correct option is B.

For more details regarding social networking, visit:

https://brainly.com/question/29708102

#SPJ6

Your question seems incomplete, the probable complete question is:

What information most likely presents a security risk on your personal social networking profile?.

A) Status

B) Birthday and hometown

C) List of favorite movies and music

D) Number of friends and followers

If you intercept a message that has been encrypted using a Caesar Cipher, what is the maximum number of times you would need to guess-and-check different keys for the cipher before cracking it

Answers

The maximum number of times you would need to guess-and-check different keys for the cipher before cracking it is; 25 times

Encryption and Decryption of Caesar Cipher

The Caesar Cipher is a type of shift cipher. Shift Ciphers work by using the modulo operator to encrypt and decrypt messages. The Shift Cipher has a key K, which is an integer from 0 to 25.

To encrypt a message, you just enter the message in the Plaintext textbox, specify the shift, and click Encrypt. However, to decrypt a message, enter the message in the Ciphertext textbox, specify the shift, and click Decrypt.

Now, For Caesar's Cipher there are only 25 possible ways to shift the alphabet and as such that is the maximum number of times you can guess and check.

Read more about Caesar Cipher at; https://brainly.com/question/14298787

What is the primary tool that retrieves data and helps users graphically design the answer to a question

Answers

Query by Example (QBE) is the primary database query tool in which the user sets conditions for search selection.

What is Query by Example?

It is a database query language where the first results presented are those that the search engine considers the most relevant for the search carried out.

It is characterized by having a system for ranking and ordering search results that allows the user to return more relevant results.

Therefore, we can conclude that Query by Example (QBE) is the primary database query tool in which the user sets conditions for search selection.

Learn more about Query by Example (QBE) here: brainly.com/question/7479160

Permissions granted from an individual for the use of a likeness is known as a

- likeness release
- location release
- model release
- media release

Answers

likeness release is the term known when a person grants you the ability to use a picture of them

Which of the following is an example of a JavaScript property?
A. window
B. border
C. document
D. table

Which of the following is an example of a JavaScript object?
A. background color
B. border
C. color
D. window

Answers

D. Window

Explanation:

Its because everything is an object in Java script

Knowledge of some sorts is likely to be represented by a broad pattern of activation spread across a network. This reflects

Answers

An subject of distributed representation relates to when some knowledge of some sorts is likely to be represented by a broad pattern of activation spread across a network.

What is distributed representation?

In technology, distributed representation refers to similar data features across multiple interdependent layers.

In conclusion, the subject of distributed representation relates to when some knowledge of some sorts is likely to be represented by a broad pattern of activation spread across a network.

Read more about distributed representation

brainly.com/question/17673062

instead of selecting a _________ and destination, I just click on the area.

Answers

url is the answer

hope this helps

scav

You have a coworker who frequently sends rude and inappropriate comments to the group instant
message platform. Which of these topics should your supervisor address with this coworker?
O collaboration
O resource management
O netiquette
O globalization

Answers

Answer: globalization

Explanation: because telling the boss will tell them why they shouldn’t do that because how it would it effect them later in life and how it would infect people too

Your best strategy would be to use a heuristic if ________ is most important; your best strategy would be to use an algorithm if ________ is most important.

Answers

Answer:

First blank : Time

Second blank : Being right

A system has defined specifications that describe how signals are sent over connections. Which layer of the Transmission Control Protocol/Internet Protocol

Answers

Answer:

What kind of question is this?! It's likely that every answer is technically right.

Explanation:

Signals being sent take place over everything. The answer you're looking for is most likely the Transport Layer though. TCP is connection-orientated.

Why is it necessary to be familiar with Microsoft Excel?

Answers

Answer:

It is necessary to be familiar with Microsoft Excel because you will be using it throughout your school years. If you don't no how to use Microsoft Excel you will have an hard time doing your assign paper you need to get done.

Etna works on many projects. As she creates a new project file, she goes to the File tab, selects Options, and then goes to the advanced category for the General section to check a box. What is she trying to do

Answers

What Etna is trying to do by going to the file tab and the general section is to Create a new file with a set of parameters.

Steps to creating a new file.

In order to create a new file you have to do the following:

You have to go to the file tab.Then you go to click optionsThe next is the advanced categorythe checkbox is located in the general section.

Following all of the steps that are listed above would help Etna as she works on her project.

Read more on ways to create files here:

https://brainly.com/question/25554117

Other Questions
oddest question but can u help me its a real school problemSuppose that an individual has a body fat percentage 18.5% of and weighs 136 pounds. How many pounds of her weight is made up of fat? Round your answer to the nearest tenth. An index fossil represents a species that lived during A. a long interval of Earth's history. B. Earth's entire history. C. a short interval of Earth's history. D. several intervals of Earth's history.which one is it? Anyone have any movies with any of the themes "everyone can make a difference", "treat others the way you want to be treated", or "everyone can make a difference."? Chloroform (CHCl3), an important solvent, is produced by a reaction between methane and chlorine.CH4(g) + 3 Cl2(g) CHCl3(g) + 3 HCl(g)How many grams of CH4 is needed to produce 56.0 g CHCl3? How did napoleon impact europe and the rest of the world. Nations with high levels of income generally have __________. A. More endemic diseases B. Lower life expectancies C. Higher life expectancies D. More respiratory diseases. Greek philosophers primarily lived in the city-state of his personality test gives results on ten scales, is good at testing for faking or random responses, and it one of the most widely used diagnostic psychological assessments. Which test is this Complete the punnet square You just bought a new laptop and paid an initial payment of $150.00. You will make 12 payments of $69.50. How much will the computer cost if your state charges 6% sales tax on the total sale. PLEASE HELP ASP!!!!!!!!!!!A birch tree that is 4 ft tall grows at a rate of 1 ft per year. A larch tree that is 6 ft tall grows at a rate of 0.5 ft per year.Let the variable t represent time in years and let the variable h represent height in feet.In how many years will the trees be the same height?Which system of equations can be used to solve this problem?{h=1+4th=0.5+6t{h=4+th=6+0.5t{h=5th=6.5t{h=4th=60.5t Explain what is Newtri from the story Cooking Time by Anita Roy. Which level of government would help people who require assistance with basic needs, such as food or medical care? I WILL GIVE BRANLIEST!! DUES IN 12 MINIUTES Municipal government National government State government National and state governments If neon has an atomic number of 10 and an atomic mass of 20, how many neutrons does it have?. If a wine company decides to focus its specialty of creating its products to rely on other business partners to fill in the supply chain gaps, which strategy is this wine company creating?. WILL GIVE BRAINLY 15 points as wellThe figure is the net for a rectangular prism.What is the surface area of the rectangular prism represented by the net?Enter your answer in the box. In a diving team, you are the team leader and you have three orientation in a trip 1-the red sea (low density) , 2-Dead sea (high density), 3-Deep lake (Pure water),which place is the best to dive in with your team.explain your opinion. What role did prophets play in salvation history? Help me pleasee guyss The question is in the picture please help fast