SuSa
Banned via Administration
Somewhere on:
http://www.uow.edu.au/~nabg/ABC/C6.pdf
"Write a program that uses Newton's laws of motion to calculate the speed and the
distance travelled by an object undergoing uniform acceleration. The program is to take
as input the mass, and initial velocity of an object, and the constant force applied and
time period to be considered. The program is to calculate the acceleration and then use
this value to calculate the distance travelled and final velocity at the end of the specified
time period."
Program I ended up writing:
http://web-dev.pastebin.com/d27400bc2
Did I do it right? >.< I don't think I needed to include math.h
EDIT:
I did it the hard way. Turns out the answer was:
Code:
double s, u, a, t;
cout << "Enter initial velocity, acceleration, and time : ";
cin >> u >> a >> t;
s = u*t + 0.5*a*t*t;
cout << "Distance travelled " << s << endl;