125k views
3 votes
The kinetic energy of a moving object is given by the formula KE = ½mv2 where m is the object’s mass and v is its velocity.Modify the program you created in Project 5 so that it prints the object’s kinetic energy as well as its momentum.Below is an example of the progam input and output:Mass: 5Velocity: 2.5The object's momentum is 12.5The object's kinetic energy is 15.625

User Zizoujab
by
5.6k points

1 Answer

3 votes

Answer:

Written in Python

mass = float(input("Mass: "))

velocity = float(input("Velocity: "))

KE = 0.5 * mass * velocity**2

momentum = mass * velocity

print("The object's momentum is "+str(momentum))

print("The object's kinetic energy is "+str(KE))

Step-by-step explanation:

This line prompts user for mass

mass = float(input("Mass: "))

This line prompts user for velocity

velocity = float(input("Velocity: "))

This line calculates kinetic energy

KE = 0.5 * mass * velocity**2

This line calculates momentum

momentum = mass * velocity

The next two lines prints the momentum and kinetic energy

print("The object's momentum is "+str(momentum))

print("The object's kinetic energy is "+str(KE))

User Mario Ene
by
4.9k points