Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65048604
rebonds2.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 31, 09:15
Size
833 B
Mime Type
text/x-c
Expires
Sun, Jun 2, 09:15 (2 d)
Engine
blob
Format
Raw Data
Handle
17995075
Attached To
R10932 CS-119
rebonds2.cc
View Options
#include <iostream>
#include <cmath>
using namespace std ;
int main()
{
cout << "Hauteur initiale H0 ?" << endl;
float H0;
cin >> H0;
if (H0 <= 0)
{
cout << "L'expérience s'effectue au-dessus du niveau de la mer." << endl;
return 0;
}
cout << "Coefficient de rebond eps ?" << endl;
float eps;
cin >> eps;
if (eps < 0 || eps >=1)
{
cout << "0 <= eps < 1" << endl;
return 0;
}
cout << "Hauteur finale désirée h_fin ?" << endl;
int h_fin;
cin >> h_fin;
if (h_fin <= 0 || h_fin >= H0)
{
cout << "0 < h_fin < H0" << endl;
return 0;
}
cout << endl;
float v, v1, h;
int i(0);
h=H0;
while (h > h_fin)
{
i=i+1;
v=sqrt(2*h*9.81);
v1=eps*v;
h=v1*v1/(2*9.81);
}
cout << "Hauteur au rebond " << i << " : " << h << endl;
return 0 ;
}
Event Timeline
Log In to Comment