C Problem 15 on page 246 of Nyhoff and Leestma. C C Report the series of heights and the distance traveled for a C bouncing ball. The user specifies the initial height and the C percentage of the height the ball obtains on a bounce relative to C the height of the previous starting point. Keep reporting until C ball height is below a minimum threshold (here set to 0.01). Also C reported are the distance traveled on a bounce (assumed to be from C one apex to the next) and the total distance traveled. C C John Schneider C CptS 203, HW 4, problem 2 C-------------------------------------------------------------------------- program bounce implicit none C..... C old = height of previous bounce C (also used to store starting height) C distot = total distance traveled by ball C dist = distance traveled by ball during "this bounce" C which I take to mean from apex of one bounce to the next C height = height of the ball at highest point in bounce C percnt = percentage of height obtained between bounces C thrshd = minimum threshold at which program stops C..... real height, percnt, thrshd, old, dist, distot parameter (thrshd=0.01) print *,'Enter initial height and bounce percentage.' read *,old,percnt C.....Convert percnt to appropriate scale factor. percnt = percnt/100.0 C.....Initialize distance variables and calculate first bounce height. dist = 0.0 distot = 0.0 height = old*percnt C..... C While the height is greater than or equal to the threshold, C accumulate the distances and report those together with the C current height. C..... 10 if (height .ge. thrshd) then dist = height + old distot = distot + dist print *, height, dist, distot old = height height = height*percnt goto 10 endif stop end