Question: Write a function named kinetic Energy that will receive objects mass (in kilograms) and velocity (in meters per second) as arguments. The function should return
Write a function named kinetic Energy that will receive objects mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has.the Function getData will receive data from the user. Demonstrate the function by calling it in a program that asks the user to enter values for mass and velocity. getData (mass, velocity); //function that receives data The input prompt message will be:Enter mass (in kilograms): _ Enter velocity (in meters per second):_ Function kineticEnergy will compute and return the kinetic energy. KE = kineticEnergy (mass, velocity); //function that returns Kinetic Energy. Function display will display the results. display (mass, velocity, KE); //function that displays results The functions are kept inside a do..while loop to repeat the process using the response (y/n).
do {
Function call
Function call
Function call
cout <<"Do you want to enter another set of data (y/n) ? "; cin >> response; }
while (response == 'y'|| response == 'Y' )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
