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]
2 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]2 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
What is wrong with my code...
stiv31 [10]
I'm not sure of the problem that you had in the first place, but I can point out that in your "bigger" method, if a number is greater than one then it is bigger, however the else statement says that the number *can* also be equal[==] to the second argument, so for example bigger(1,1) it would check if 1 > 1 and return false, so it will return that b[the second 1] is bigger! Hope this helps :D
3 0
3 years ago
Louis is a civil engineer and wants to use a line on a floor plan that is indicative of the position from which a section is tak
frutty [35]

Answer:

A

Explanation:

horizontal line

8 0
2 years ago
Read 2 more answers
Selah infects the ads on a website that users from her target company frequently visit with malware as part of her penetration t
ValentinkaMS [17]

Selah infects the ads on a website with a technique called the Watering hole attacks.

<h3> What is Watering hole attacks?</h3>

The  Watering hole attacks is known to be a form of attack that depends on compromising or infecting a website that has or that targeted users who are known to often frequently visit.

So, Selah infects the ads on a website with a technique called the Watering hole attacks.

Learn more about malware from

brainly.com/question/399317

#SPJ1

8 0
1 year ago
Which of the following statements expresses why the following code is considered bad form? for (rate = 5; years-- &gt; 0; System
OlgaM077 [116]

Answer:

l and ll only that is the answer

7 0
3 years ago
Read 2 more answers
While a threat intelligence analyst was researching an indicator of compromise on a search engine, the web proxy generated an al
inna [77]

Answer: the corret answer C. The analyst has prefetch enabled on the browser in use.

Explanation:

The analyst has like an indicator which is prefetch enabled on the browser in use.

7 0
2 years ago
Other questions:
  • Discuss the differences between permanent internal memory and volatile internal memory.
    14·1 answer
  • Owning provides _________ flexibility but can lead to _________ costs in the long-term.
    7·2 answers
  • An iphone is a form of a computer
    7·2 answers
  • Science is a body of knowledge that extends back to Select one: a. the time of Galileo. b. Italy in the 16th century. c. Greece
    6·1 answer
  • One common method of converting symbols into binary digits for computer processing is called ASCII​ (American Standard Code of I
    5·1 answer
  • Given a String variable response that has already been declared, write some code that repeatedly reads a value from standard inp
    10·1 answer
  • What is the term used to describe a computer system that can store literary documents, link them according to logical relationsh
    5·1 answer
  • Which option represents the location of the Goal Seek function?
    8·2 answers
  • Why do certain words change color in Python?
    6·1 answer
  • Where is the flash drive listed in a windows 7 save as dialog box?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!