A basketball is dropped from a given height (height), and on each bounce, it reaches a maximum
Fantastic news! We've Found the answer you've been seeking!
Question:
A basketball is dropped from a given height (height), and on each bounce, it reaches a maximum height that is 55% of its previous height. Write a method that returns the height reached by the basketball after bounces number of bounces.
public static double bounceHeight(double height, int bounces){
/* YOUR RECURSIVE SOLUTION GOES HERE*/
}
System.out.printf("%.2f\n", bounceHeight(15, 5)); // Should return 0.75
System.out.printf("%.2f\n", bounceHeight(15, 0)); // Should return 0.0
Related Book For
A Survey of Mathematics with Applications
ISBN: 978-0134112107
10th edition
Authors: Allen R. Angel, Christine D. Abbott, Dennis Runde
Posted Date: