Im trying to write a program thats uses call function, but for some reason the program.
Can someone help point out what i might be missing in the code?
#include <iostream>
#include <cmath>
using namespace std;
void timeoffall();
void velatimpact();
int main ()
{
double h;
cout << "Please enter the height from which the ball was dropped" << endl;
cin >> h;
timeoffall();
velatimpact();
return 0;
}
void timeoffall(double h)
{
double timeoffall;
timeoffall = sqrt (h/4.9);
cout << "the ball was in the air for " << timeoffall << "seconds" <<endl;
}
void velatimpact(double timeoffall)
{
double velatimpact;
velatimpact = (-9.8 * timeoffall);
cout << "the velocity at impact was: " << velatimpact << "m/s" << endl;
}