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
Problem You Need to Solve for This Lab:
Paraphin [41]

Answer:

Write questions properly

Explanation:

Then it is easy to say answer

4 0
3 years ago
Which option lists the computer components in order from oldest to newest?.
Zolol [24]

Answer:

Transistors, vacuum tubes, integrated circuits, personal computers, microprocessors.

Explanation:

These are the computer components in order from oldest to newest

3 0
2 years ago
What type of file format is PSD?
Ronch [10]

Answer:

PSD (Photoshop Document)

Explanation:

PSD (Photoshop Document) is an image file format native its one of Adobe's popular Photoshop Application. PSD files are commonly used for containing high quality graphics data.

8 0
3 years ago
Read 2 more answers
Match each logical function with its description. AND COUNTIF SUMIF IF tests for a certain condition and returns one of two valu
lakkis [162]
1. IF
2. AND
3. COUNTIF
4. SUMIF
4 0
4 years ago
Pedro would like to create a computer program to add two numbers. The commands for the algorithm he created are:
Usimov [2.4K]
Press the equal number.

For example:
Press the equal button: = (this step can go first or last)
Enter the first number: 5
Press the addition button: +
Enter the second number: 4
Press the equal button: =
3 0
3 years ago
Other questions:
  • Qual foi o primeiro computador no mundo a ser criado e qual é a hitória por trás?
    8·1 answer
  • In addition to MLA, what are some other widely used style guides? Check all that apply.
    6·2 answers
  • Digital information is stored using a series of ones and zeros. Computers are digital machines because they can only read inform
    15·1 answer
  • How did the movie characterized being a genius on real genius movie
    13·2 answers
  • Write a program (C++) that reads a number between 1,000 and999,999 from the user where the user enters a comma in the input.Then
    13·1 answer
  • Why do some people put salt on sidewalks when it snows?
    14·1 answer
  • Write the name of the tab, the command group, and the icon that you need to use to justify
    14·1 answer
  • Who watches Riverdale ? if you do can we be friends(pLEASE DON'T DELETE) and also who is your fav character from Riverdale
    8·2 answers
  • Generally speaking, what is a “best practice"?
    13·1 answer
  • Creation of network is known as…?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!