Answer to Question #225873 in C++ for Ulando

Question #225873

Write program to calculate the distance from second equation of linearly accelerated motion. The formula for the calculation is

S=u*t+(/2*a*t*t


1
Expert's answer
2021-08-13T16:12:56-0400
#include <iostream>
using namespace std;
int main()
{
	cout << "Please enter u,t,a:\n";
	cout << "u=";
	double v, t, a;
	cin >> v;
	cout << "t=";
	cin >> t;
	cout << "a=";
	cin >> a;
	double S = v * t + (a * t * t)/2.0;
	cout << "S=" << S << endl;
	return 0;
}
/*
for example 
u=5  (speed)
t=2 (time)
a=1 (acceler)
S=5*2+1/2*1*2*2
=10+0.5*4
=12


*/

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS