fork download
  1. <?php
  2.  
  3.  
  4.  
  5. $startup = 10000;
  6. $percent = 1.1;
  7. $totalMoney = 10000;
  8. $year = 1;
  9.  
  10.  
  11. $depositBalance = 10000;
  12. $percent = 1.1;
  13. $age = 16;
  14. $year = 1;
  15. $earningsTotal = 0;
  16.  
  17.  
  18. for ($year = 1; $earningsTotal <= 1000000; $year++) {
  19. $earningsTotal = ($depositBalance * $percent);
  20. $earningsTotal = floor ($earningsTotal);
  21. $depositBalance = $earningsTotal;
  22. $age++;
  23. echo "Year {$year}. You've got $earningsTotal on your balance this year.\n";
  24.  
  25.  
  26. if ($earningsTotal >= 1000000) {
  27. echo "WOW! You've earned ONE BILLION DOLLARS! Now you're {$age}, so if you're not dead yet, you can spend it whenever you want!\n";
  28. break;
  29. }
  30. }
  31.  
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
Year 1. You've got 11000 on your balance this year.
Year 2. You've got 12100 on your balance this year.
Year 3. You've got 13310 on your balance this year.
Year 4. You've got 14641 on your balance this year.
Year 5. You've got 16105 on your balance this year.
Year 6. You've got 17715 on your balance this year.
Year 7. You've got 19486 on your balance this year.
Year 8. You've got 21434 on your balance this year.
Year 9. You've got 23577 on your balance this year.
Year 10. You've got 25934 on your balance this year.
Year 11. You've got 28527 on your balance this year.
Year 12. You've got 31379 on your balance this year.
Year 13. You've got 34516 on your balance this year.
Year 14. You've got 37967 on your balance this year.
Year 15. You've got 41763 on your balance this year.
Year 16. You've got 45939 on your balance this year.
Year 17. You've got 50532 on your balance this year.
Year 18. You've got 55585 on your balance this year.
Year 19. You've got 61143 on your balance this year.
Year 20. You've got 67257 on your balance this year.
Year 21. You've got 73982 on your balance this year.
Year 22. You've got 81380 on your balance this year.
Year 23. You've got 89518 on your balance this year.
Year 24. You've got 98469 on your balance this year.
Year 25. You've got 108315 on your balance this year.
Year 26. You've got 119146 on your balance this year.
Year 27. You've got 131060 on your balance this year.
Year 28. You've got 144166 on your balance this year.
Year 29. You've got 158582 on your balance this year.
Year 30. You've got 174440 on your balance this year.
Year 31. You've got 191884 on your balance this year.
Year 32. You've got 211072 on your balance this year.
Year 33. You've got 232179 on your balance this year.
Year 34. You've got 255396 on your balance this year.
Year 35. You've got 280935 on your balance this year.
Year 36. You've got 309028 on your balance this year.
Year 37. You've got 339930 on your balance this year.
Year 38. You've got 373923 on your balance this year.
Year 39. You've got 411315 on your balance this year.
Year 40. You've got 452446 on your balance this year.
Year 41. You've got 497690 on your balance this year.
Year 42. You've got 547459 on your balance this year.
Year 43. You've got 602204 on your balance this year.
Year 44. You've got 662424 on your balance this year.
Year 45. You've got 728666 on your balance this year.
Year 46. You've got 801532 on your balance this year.
Year 47. You've got 881685 on your balance this year.
Year 48. You've got 969853 on your balance this year.
Year 49. You've got 1066838 on your balance this year.
WOW! You've earned ONE BILLION DOLLARS! Now you're 65, so if you're not dead yet, you can spend it whenever you want!