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
Visual media that gives the appearance of a movement can be a collection of graphics<br>​
krok68 [10]

its called animation, a collection of a movement of graphics.

6 0
3 years ago
Read 2 more answers
Please help I’ll give brainleistt
iren2701 [21]

Answer:

7. B

8. A

9. B

10. B

11. A

Explanation:

6 0
2 years ago
The ____ command will confirm the system directory that you are currently in
stira [4]
Im pretty sure the answer is PWD
7 0
3 years ago
What does txt atm mean? what does txt atm mean
Stolb23 [73]
I think it means text
3 0
3 years ago
Write a program that reads numbers from the user until a blank line is entered. Your
ddd [48]

Answer:

nums = []

while True:

   in = input()

   if in:

       nums.append(in)

   else:

       break

if nums:

   avg = sum(nums) / len(nums)

   for i in range(len(nums)):

       if nums[i] == avg:

           print(f"index: {i+1}")

           print(nums[i])

else:

   print(-1)  # if there aren't any values in nums

Explanation:

Assuming that you are coding in Python 3x. The last 'else' statement is an edge case that you might want to consider, I don't know what you want to put there, but I'm just going to leave it as -1.

5 0
3 years ago
Other questions:
  • In three to five sentences, describe how good e-mail work habits increase workplace efficiency and productivity.
    12·1 answer
  • C programming question:
    12·1 answer
  • What does remedy mean
    7·2 answers
  • The parts of a memo are _____.
    9·2 answers
  • What was the first computer programming language?
    7·2 answers
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    12·2 answers
  • Favorite color should it be stored why?or why not?<br>​
    6·1 answer
  • How can you remove background noise from a video?
    15·2 answers
  • put together a shopping list of items that a first responder should always have at immediate disposal in a field kit. Using curr
    11·1 answer
  • Which directory contains the initrd file? in suse linux
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!