Description
When a ball falls from an initial height h, its speed s when it reaches the floor is given by the relation: 𝑠 = √2 ∗ h ∗ g where g is the gravity constant 9.81. Immediately after hitting the floor, its speed
becomes s1 = eps*s (where eps is a constant and s its speed before rebounding). The ball will then reach the height h1 = (𝑠1)2 /(2 ∗ 𝑔) = (𝑠 ∗ 𝑒𝑝𝑠)2 /(2 ∗ 𝑔). After n rebounds, what is the equation of the height reached by the ball?
Write a program (rebounding.cpp) that computes the height reached the ball after rebound 1, 2, ..., n rebounds. Print a statement before the height reached.
Your program should define the constant g
Your program should request from the user:
- - h0 (the initial height)
- - eps (the rebound coefficient, 0< eps <1)
- - n (the number of rebounds, 0<= n) For h0 = 25, eps = 0.9, and n = 10, the height obtained should be around 3.04
To use sqrt() function you will need to #include <cmath>
Explanation & Answer
This is the progra...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
A Portrait of the Artist as a Young Man
by James Joyce
The Glass Castle
by Jeannette Walls
What Happened
by Hillary Clinton
Catch-22
by Joseph Heller
A Farewell To Arms
by Ernest Hemingway
Enders Game
by E. M. Forster
Breakfast at Tiffanys
by Truman Capote
The Underground Railroad
by Colson Whitehead