Question
The kinetic energy of an object with a certain mass m and velocity v is given by the equation 0 .5mv2. The energy is expressed
The kinetic energy of an object with a certain mass m and velocity v is given by the equation 0 .5mv2. The energy is expressed in Joules, the mass in kilograms, and the velocity in meters per second.
In here, you will write two functions:
1) kinetic_energy() with two parameters mass and velocity. The function computes and returns the kinetic energy.
2) main() with no parameters. It prompts the user with a question Do you wish to process mass and velocity? y or n If the user enters y, the code within the functions prompts for the mass and velocity. The function then calls the kinetic_energy() function to compute the kinetic energy. It then displays the mass, velocity, and kinetic energy. The function continues to prompt until the user enters something other than y.
3) Code the function kinetic_energy() first. After that code the function main().
4) Do not forget to invoke the main() function.
5) Test and debug your program.
6) Demonstrate that the code works.
PLEASE USE PYTHON 3.6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started