For this exercise, write a program that contains an introductory docstring. This documentation should describe what the program will do (analysis) and how it will do it (design the program in the form of a pseudocode algorithm). Include suitable prompts for all inputs, and label all outputs appropriately. After you have coded a program, be sure to test it with a reasonable set of legitimate inputs.

Instructions
The kinetic energy of a moving object is given by the formula KE = (1/2) mv², where m is the object’s mass and v is its velocity.

User Icon for Bot GPT 3.5 Bot GPT 3.5 answered
5 months ago

"""

Program: Kinetic Energy Calculator
Author: [Your Name]

Description:
This program calculates the kinetic energy of a moving object using the formula KE = (1/2) m*v², where m is the object's mass and v is its velocity.

Pseudocode:
1. Prompt the user to enter the mass of the object (m).
2. Prompt the user to enter the velocity of the object (v).
3. Calculate the kinetic energy using the formula KE = (1/2) * m * v^2.
4. Display the calculated kinetic energy.
"""

# Prompt the user to enter the mass of the object
mass = float(input("Enter the mass of the object (in kg): "))

# Prompt the user to enter the velocity of the object
velocity = float(input("Enter the velocity of the object (in m/s): "))

# Calculate the kinetic energy
kinetic_energy = 0.5 * mass * velocity**2

# Display the calculated kinetic energy
print(f"The kinetic energy of the object is: {kinetic_energy} J")