
Originally Posted by
munkalla
But what if what i have to do with the time is a bit more complicated then simply doubling it... like using one of the formulas given in the initial question
Why not try to write any formula using C++? The compiler isn't a bomb -- it isn't going to blow up on you if you make a mistake.
Code:
#include <cmath>
int SomeFormula( double timevalue, double vZero );
int main()
{
double time1 = 0.5; //time in seconds
double result;
result = SomeFormula( time1, 0.0 );
}
int SomeFormula( double timevalue, double VZero )
{
return VZero + 0.5 * (32.0 * pow(timevalue. 2.0));
}
Recognize that formula? It is different than yours, and is more "complicated" than doubling.
The way you learn is to write sample functions and familiarize yourself with the way to call them. If you make a mistake, just keep reading books and trying until you understand and get it correct.
Regards,
Paul McKenzie