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
lbvjy [14]
3 years ago
7

Write a program Ticket.py that will allow the user to enter actual speed

Computers and Technology
1 answer:
natita [175]3 years ago
5 0

Answer:

Following are the code to the given question:

def speedlimit():#defining a method speedlimit

a= int(input("Enter the offender's speed in mph: "))#defining a variable for input value

lim = int(input("Enter the speed limit in mph: "))#defining a variable for input value

n = int(input("The number of previous tickets that person has received: "))#defining a variable for input value

if (lim >= 20) and (lim < 70):#defining if block to check speed is between 20 to 70

if a > lim:#use if to check lim value greater than a

print("Driver was going", a-lim, "mph over the limit.")#print calculated value with message

print("The cost of the speeding ticket $",10*(a-lim))#print calculated value with message

else:

print( "Driver was going at a legal speed.")#print message

else:

print('Invalid speed limit.')#print calculated value with message

print("Court cost $",(50 + n*20))#print calculated value with message

speedlimit()

Output:

Please find the attached file.

Explanation:

In this code, a method "speedlimit" is declared that defines three variables that are "a, lim, and n" in which we input value from the user-end.

Inside the method, a nested conditional statement is used that checks the speed value is between 20 to 70 if it is true it will go to the next condition in which it checks lim value greater than a. It will use a print message that will print the calculated value with the message.

You might be interested in
The four levels of administration necessary to keep human services organization operating smoothly.
noname [10]
The four levels of administration that is necessary to keep human services organization run smoothly are; 1. Top management, 2. Middle management, 3. Lower management,4. Operational management.
3 0
3 years ago
Cuento sobre la creación de algún videojuego​
Y_Kistochka [10]

Answer:

Historia de los videojuegos

Los inicios

Durante bastante tiempo ha sido complicado señalar cual fue el primer videojuego, principalmente debido a las múltiples definiciones de este que se han ido estableciendo, pero se puede considerar como primer videojuego el Nought and crosses, también llamado OXO, desarrollado por Alexander S.Douglas en 1952. El juego era una versión computerizada del tres en raya que se ejecutaba sobre la EDSAC y permitía enfrentar a un jugador humano contra la máquina.

En 1958 William Higginbotham creó, sirviéndose de un programa para el cálculo de trayectorias y un osciloscopio, Tennis for Two (tenis para dos): un simulador de tenis de mesa para entretenimiento de los visitantes de la exposición Brookhaven National Laboratory.

Este videojuego fue el primero en permitir el juego entre dos jugadores humanos. Cuatro años más tarde Steve Russell, un estudiante del Instituto de Tecnología de Massachussets, dedicó seis meses a crear un juego para computadora usando gráficos vectoriales: Spacewar.

En este juego, dos jugadores controlaban la dirección y la velocidad de dos naves espaciales que luchaban entre ellas. El videojuego funcionaba sobre un PDP-1 y fue el primero en tener un cierto éxito, aunque apenas fue conocido fuera del ámbito universitario.

En 1966 Ralph Baer empezó a desarrollar junto a Albert Maricon y Ted Dabney, un proyecto de videojuego llamado Fox and Hounds dando inicio al videojuego doméstico. Este proyecto evolucionaría hasta convertirse en la Magnavox Odyssey, el primer sistema doméstico de videojuegos lanzado en 1972 que se conectaba a la televisión y que permitía jugar a varios juegos pregrabados.

4 0
3 years ago
Read 2 more answers
When an "is a" relationship exists between objects, it means that the specialized object has all the characteristics of the gene
Nutka1998 [239]

Answer:

This characteristics is called Polymorphism in the concept of Object Oriented Programming.

Explanation:

Polymorphism is one of the characteristics of Object Oriented Programming (OOP). It is also known as an "is a" relationship between objects.

Polymorphism is the ability of an object to take on many forms. It is commonly used when a parent class reference is used to refer to a child class object.

For instance; we have an Animal class, then a Dog class which inherit from the Animal class. We can then say a Dog is an animal (Polymorphism).

6 0
3 years ago
Which of the following improved networks by increasing speed or by improving the ability for businesses to use networks? Check a
user100 [1]

Answer: ethernet, isdn, gigabit ethernet

Explanation:

7 0
3 years ago
Read 2 more answers
How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
olchik [2.2K]

Answer:

Bill Gates used his skills and brains to build a business. In conclusion, Bill Gates was very successful with his industry thanks to free enterprise. He, along with his employees and friends, created and almost perfected the software known as Microsoft. The free enterprise system provides the right to private enterprise, which allowed him to choose his own business and to run it without governmental influence. Because he could create his own business and design his own products, Gates was able to specialize in technology.

Explanation:

8 0
3 years ago
Other questions:
  • Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
    7·1 answer
  • Suppose the program counter (pc) is set to 0x2000 0000. is it possible to use the jump (j) mips assembly instruction to set the
    15·1 answer
  • Technician A says one disadvantage of fiber optic cables is that they are more expensive and very heavy. Technician B says one d
    6·1 answer
  • List 7 ways of generating<br>airlines​
    15·2 answers
  • Time Conversion C++: Given a time in -hour AM/PM format, convert it to military (24-hour) time.
    9·1 answer
  • How do I learn coding? Python
    5·2 answers
  • When reading words with a scanner object, a word is defined as ____?
    15·1 answer
  • Write and test a Python program to find and print the largest number in a set of real (floating point) numbers. The program shou
    5·1 answer
  • 5. In which of the following stages of the data mining process is data transformed to
    9·1 answer
  • PLEASE HELP ME!!!!!! ITS FOR 100 POINTS AND BRAINLIEST!!!!!!!! NO ONE EVER WANTS TO ANSWER MY QUESTION!!! I JUST NEED SOMEONE TO
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!