14,664,481 members

```
#include <iostream>
using namespace std;
int main ()
{
double dt = 0.10; //(it is constant)
double t = 0.00;
double dx = 0.10; //(it is constant)
double x = 0.00;
double ddy = 1.00; //(it is constant)
double dy = 0.00;
double y = 1.00;
cout<<"t = "<<t<<endl;
cout<<"dx = "<<dx<<endl;
cout<<"x = "<<x<<endl;
cout<<"dy = "<<dy<<endl;
cout<<"y = "<<y<<endl;
cout<<endl;
while(t<=5)
{
x = x + dx*dt;
dy = dy - ddy * dt * dt;
y = y + dy * dt;
if (y<=-1)
{
y = -y;
dy = -dy * 0.70;
}
t = t + dt;
cout<<"t = "<<t<<endl;
cout<<"dx = "<<dx<<endl;
cout<<"x = "<<x<<endl;
cout<<"dy = "<<dy<<endl;
cout<<"y = "<<y<<endl;
cout<<endl;
}
system("pause");
}
```

Comments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada
+1 416-849-8900 x 100

maybe it can help you !