iDontKnow
2012-03-26 14:44:16 UTC
heres the question:
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:
d=1/2gr^2
The variables in the formula are as follows: D is the distance in meters, g=9.8, and t the amount of time in seconds that 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 the time interval. Write a program that demonstrates the function by calling it ina loop that passes the values 1-10 as arguments displays the return value.
here's what i got so far:
#include
#include
#include
using namespace std;
const double grav=9.8;
double fallingDistance(double time, double distance);
int main()
{
for (int time=0; time<10; time++)
fallingDistance(time);
return 0;
}
double fallingDistance (double time)
{
double distance=0;
cout<<"please enter the time it took the object to fall:"<
distance=(1/2)grav*pow(time,2.0);
cout<<"the distance is"<
}