Guest User

Untitled

a guest
Nov 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. public int yearsTilOneMillion(double initialBalance) {
  2. int year = 1;
  3. double savings = initialBalance;
  4. while (savings < 1000000){
  5. savings = savings * 1.05;
  6. year++;
  7. }
  8. return year;
  9. }
Add Comment
Please, Sign In to add comment