The program below is the answer to Deitel’s Java How to Program (9th Edition) Chapter 2 Exercise 2.34.

Question: Use the web to determine the current world population and the annual world population growth rate. Write an application that inputs these values, then displays the estimated world population after one, two, three, four and five years.


Click here to see other answers to Java How to Program.

8 Comments

  1. I'm not sure. It is supposed to work. Check your value very well. Maybe you typed extra digits.

  2. I tried double for currentPop but in Eclipse Neon.3 it tells me that value over 7 billion is out of range. Why?

  3. Thank you so so much for the correction. Didn't think of it that way – logic error! It has been corrected.

    P.S. I'm glad you find it helpful.

  4. The workig data estimated pop * number of years is wron i Think as estimatedpop becomes after one year but multiplying estimatedpop by 2 for the population after two years is mathematical problem which staes that growth rate was 200%. Instead it should be estimatedpop + growth/100 * estimated pop to be precise but if it was just a simple calculation you need to multiply the annualpopincrease by 2 and add it to estimatedpop.

    I do not mean to be rude and also THANKS A LOT FOR PROVIDING THE SOLUTIONS IT IS HELPING ME A LOT.

Write A Comment