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
drek231 [11]
3 years ago
12

Write a program which will enter information relating to a speeding violation and then compute the amount of the speeding ticket

. The program will need to enter the posted speed limit, actual speedthe car was going, and whether or not the car was in a school zone.
Computers and Technology
1 answer:
Paraphin [41]3 years ago
7 0

Answer:

In Python:

speedlimit = int(input("Speed Limit: "))

actualspeed = int(input("Actual Speed: "))

schoolzone = int(input("School Zone? (1 - Yes): "))

ticket = 75

difference = actualspeed - speedlimit

ticket += difference * 6

if difference > 30:

   ticket += 160

if schoolzone == 1:

   ticket*=2

   

print("Ticket: "+ticket)

Explanation:

See attachment for complete question:

The next three lines get the speed limit, actual speed and if the driver is in a school zone

<em>speedlimit = int(input("Speed Limit: "))</em>

<em>actualspeed = int(input("Actual Speed: "))</em>

<em>schoolzone = int(input("School Zone? (1 - Yes): "))</em>

This initializes the ticket amount to 75

ticket = 75

This calculates the difference in the speed limit and the actual speed. It is assumed that the actual speed will always be greater than the speed limit

difference = actualspeed - speedlimit

This calculates the new ticket by charging $6 on every additional speed

ticket += difference * 6

If the difference is greater than 30, this adds $160 to the ticket amount

<em>if difference > 30:</em>

<em>    ticket += 160</em>

If in school zone, this doubles the ticket amount

<em>if schoolzone == 1:</em>

<em>    ticket*=2</em>

This prints the calculated ticket amount    

print("Ticket: "+ticket)

You might be interested in
Which strategy would most likely improve a student's reading comprehension?
Fynjy0 [20]

Answer:

I think asking questions is the best.

Explanation:

I believe asking questions are the best because you get to understand the text which is really good. Some 7th grade reading teachers can help you a lot and you can use iLit to help a bunch.

8 0
3 years ago
Read 2 more answers
Question 5 (2 points)
Scrat [10]

Answer:

B) 5 m/s

Explanation:

Took the test and this was the correct answer :)

6 0
3 years ago
Why are computer messages encapsulated?
Tcecarenko [31]

Answer:

I think the answer is to translate messages from one machine’s programming language into another

Explanation:

6 0
3 years ago
A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of
12345 [234]

Answer:

Keeping the numeric values in a list makes it easier to apply the same computation to every data element.

Explanation:

A list or array in programming is a data structure, that has the location for each item it holds indexed. It eliminates the need to constantly create a variable to compute items of the same data types.

The list can store items of the same data type and iterate over them to compute the same calculation on each of them.

5 0
3 years ago
Can someone please give me example of three types of loop in pascal (It has to has randomize in it too)
Lubov Fominskaja [6]

Sr.No Loop Type & Description
2 for-do loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
3 repeat-until loop Like a while statement, except that it tests the condition at the end of the loop body. (HOPE THIS HELPS!!)
3 0
3 years ago
Other questions:
  • If you want to access your files anywhere from almost any connected device, you should store your files on your ________.
    9·1 answer
  • has anyone noticed that brainly has been giving the wrong answers and that the ads are blocking answers or is that just me?
    7·2 answers
  • Tables draw your attention to specific information in a spreadsheet. Please select the best answer from the choices provided T F
    10·1 answer
  • To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu.
    12·1 answer
  • If you commit license fraud by using an altered or unlawful license:
    11·2 answers
  • ____ is designed for short-distance connections and has only a few lambdas, with a greater space between lambdas. Group of answe
    9·2 answers
  • The following pseudocode is an example of ____.do stepAdo stepBif conditionC is true thendo stepDelsedo stepEendifwhile conditio
    15·1 answer
  • Which type of operating system is usually used in personal computers
    13·1 answer
  • An application calculates an ending inventory amount based on a beginning inventory amount, sales, and returns. You need to crea
    8·1 answer
  • Hi i choose brainlyest 4 free
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!