For this project, upload 2 files:1 your source file in rebounds.cpp2 your text file generated (HeightReached.txt)Submit both files at the same time.
EEGR 161 Fall 2017
Project 3
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 ℎ1 = ( 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 by the ball after 1, 2, …, n rebounds
and save the data in file called HeightReached.txt. 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>
“Are you looking for this answer? We can Help click Order Now”
The post i need a help for my home works first appeared on Nursing Essays Writers.
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”
The post i need a help for my home works first appeared on nursing writers.