/******************************************************************* CS167/467 C Programming, Fall 1999 The Bouncing Ball A rubber ball loses a fraction of its energy every time it bounces. Eventually it does not have enough energy to bounce again, and it simply stops. You task is to write a program to calculate the total distance traveled by a bouncing ball when dropped from a height which is to be read from the keyboard. The two other factors to be input are the "bounce ratio", i.e. the ratio of the bounce height to the previous height, and the cut-off height after which the ball rolls. For instance, say the ball is dropped from 10 ft., the bounce ratio is 0.6, and the cut-off is 0.1 ft. The ball will then travel a total of 10 + 6 + 6 + 3.6 + 3.6 + 2.16 + 2.16 + etc. ft. before it stops bouncing. Notice that the program needs to add each successive height twice, except for the first one. Below is a skeleton for this program. Clearly the program needs a while loop, but you will have to find the correct termination test for the loop. Follow the usual steps as in previous lab assignments in order to complete this assignment. Run the program on these test inputs for you submission: initial height 10 ft. bounce ratio 0.6 cut-off 0.1 ft. Don't forget to hand me (RTH) a printout of your source code with the following output: initial height bounce ratio cut-off total distance traveled before rolling number of bounces (number of times the ball hits the ground, including the last time when it doesn't rise again) Also, don't forget to mail your source code to Bing: % mail byao < mycode.c Notes o you will need to use scanf with a %f specifier to read the floating point numbers from the keyboard o similarly use %f in a printf format string to print floating point numbers o you will need a float variable to hold the total distance traveled and an integer to hold the bounce count ****************************************************************/ /***************************************************************** CS167 C Programming, Section 2, Spring 1998 The bouncing ball This program ... (put a brief description here) Author: (put your name here) *****************************************************************/ #include int main() { ... (declare variables here) ... (initialize variables, read input values from keyboard) while (... (put termination test here)) { ... (do calculations here) } ... (print out results here) return 0; }