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
Powerpoint increased the weight of a line in ____ increments.
USPshnik [31]
<span>One-fourth increments</span>
4 0
3 years ago
Suppose we want to design a combinational logic block that accepts a 4 bit Binary number as input. Let the most significant bit(
labwork [276]

Answer:

I'm sorry I'd been looking at this question a while and I can't seen to figure it out.

3 0
3 years ago
I will give you brainliest!!!
Feliz [49]

Answer:

sure i dont mind subbing

Explanation:

7 0
3 years ago
Read 2 more answers
Write a method that takes three numerical String values and sums their values. For example, the call sumStrings("1", "5", "7") w
masha68 [24]

Answer:

public static int sumStrings(String s1, String s2, String s3) {

       int i1 = Integer.parseInt(s1);

       int i2 = Integer.parseInt(s2);

       int i3 = Integer.parseInt(s3);

       

       int sum = i1 + i2 + i3;

       return sum;

   }

Explanation:

- Create a method called <em>sumStrings</em> that takes three strings

- Convert each string to integer using Integer.parseInt() method

- Sum the strings

- Return the result

7 0
3 years ago
Write an application that reads an English-language phrase and encodes it into Morse code. Also write an application that reads
Morgarella [4.7K]

Answer: English to Morse code. Hello my name is Isabella:   .... . .-.. .-.. --- / -- -.-- / -. .- -- . / .. ... / .. ... .- -... . .-.. .-.. .-

Morse code to English: .. / .-.. .. -.- . / -- .- - ....  is I like math

6 0
3 years ago
Other questions:
  • Tommy has hired a marketing company to create a billboard advertisement
    11·2 answers
  • You have been hired to set up a network for XYZ Enterprises. What factors will you consider to determine the type of network nee
    7·2 answers
  • What do TCP/IP MEAN​
    7·1 answer
  • Why is Brainly always deleting either my answers or my questions? I am putting nothing inappropriate in them. Can someone answer
    7·2 answers
  • Field names should NOT start with a(n) -<br> hyphen (-)<br> Oa<br> asterisk (*)<br> space()
    8·1 answer
  • Using e-mail has decreased the number of hand-written letters that people send to their friends and relatives. this is a ____ fu
    11·1 answer
  • For an machine using 2-dimensional even parity for error detection/correction, and the following received bytes, where is the er
    9·1 answer
  • Discuss the importance of top management commitment and the development of standards for successful project management. Provide
    10·1 answer
  • 9. Question
    5·1 answer
  • Why backup system of data and software is necessary. ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!