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
write a simple assembly code using 8088 microprocessor instruction set to add two numbers ? please help me if you know :(​
Kay [80]

Answer:

sexxxxx chaaaaat insta id abhilash0351

3 0
3 years ago
Supervisor: You will need to consolidate your trouble tickets
liubo4ka [24]
Wheres the rest???????????????????
7 0
2 years ago
Harold wants to create a design that would depict the innocent and evil sides of human nature. Which colors can Harold use to de
belka [17]

Answer:

Usually good and evil are depicted as black and white or red and white. White being good, or pure.

Explanation:

8 0
3 years ago
wooooooooo helll yeaaa made it to ACE baby now road to whatever next, lil present imma be doing You tube soon soo ideas will be
vichka [17]

Answer:yo bro I don’t know but the answer is b

Explanation:

8 0
3 years ago
Read 2 more answers
ASAP!!!!****** Need help!!!!
m_a_m_a [10]
I think it's right. 
<span>Text, numbers, graphics, or sound represented by discrete digits, such as 1s and 0s.</span>
6 0
3 years ago
Other questions:
  • reate a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the
    5·1 answer
  • Software that interprets commands from the keyboard and mouse is also known as the
    8·1 answer
  • 1)Ce procent de grasimi putem găsi in lapte ?
    10·1 answer
  • Small robots that can move around on the surface of a planet are called space shuttles.
    12·2 answers
  • Richard needs to copy information from another slide presentation that uses a different design template. To ensure that the info
    10·1 answer
  • What is the output of the following code:
    12·1 answer
  • I recorded a video on my windows PC, but when i tried to play it i got this message:
    6·2 answers
  • Many ____ classes for certification are available on the Internet and by many companies that have set up intranets within their
    15·1 answer
  • 10.
    15·1 answer
  • Data frames can be subset by a chosen value using ==.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!