Assume that the current population of California is 39 million and that the population of Texas is

Question:

Assume that the current population of California is 39 million and that the population of Texas is 28 million. The population of Texas appears to be growing at a faster rate than that of California. Write an application that accepts values for the projected growth rate of each state and computes the number of years it will take for the population of Texas to exceed California’s. Use a recursive method that accepts the two growth rates, the two current populations in millions, and the current year (starting with 0), and then displays the population for each future year until the population of Texas is greater. If the user enters a smaller rate for Texas than for California, force the California rate to 0. The method returns an integer that represents the number of years in the future when the shift finally occurs. Save the program as PopulationRecursive.java.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 9780357673423

10th Edition

Authors: Joyce Farrell

Question Posted: