Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Physics Functions Falling Distance When an object is falling because of gravity,

ID: 3896102 • Letter: P

Question

Physics Functions

Falling Distance
When an object is falling because of gravity, the following formula can be used to
determine the distance the object falls in a specific time period:


The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t
is the amount of time, in seconds, that the object has been falling.

Write a function named fallingDistance that accepts an object’s falling time (in
seconds) as an argument. The function should return the distance, in meters, that the
object has fallen during that time interval.

Kinetic Energy
In physics, an object that is in motion is said to have kinetic energy. The following
formula can be used to determine a moving object’s kinetic energy:

The variables in the formula are as follows: KE is the kinetic energy, m is the object’s
mass in kilograms, and v is the object’s velocity, in meters per second.
Write a function named kineticEnergy that accepts an object’s mass (in kilograms)
and velocity (in meters per second) as arguments. The function should return the
amount of kinetic energy that the object has. Demonstrate the functions by calling them in
a program that asks the user to enter the following values:

time for fallingDistance

mass and velocity for kineticEnergy

Explanation / Answer

#include "stdafx.h"
#include<iostream.h>
double fallingDistance(int);
int main()
{int i;
double distance;
cout<<" Time Distance ";
for(i=1;i<=10;i++)
{distance=fallingDistance(i);
cout<<" "<<i<<" "<<distance<<endl;
}
system("pause");
return 0;
}//end main

//function definition
double fallingDistance (int time)
{
double distance, g=9.8;
distance = static_cast<double> (0.5*g*time*time);
return distance;
}
//end falling distance