Guest User

Untitled

a guest
Apr 27th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1.  
  2. public class WhileInvestment {
  3.  
  4. public static void main (String args[])
  5. {
  6. int year =0;
  7. double money = 10500;
  8. double increment = 0.05;
  9. double balance = 0;
  10. double newbalance;
  11.  
  12. while (year>6)
  13. {
  14. balance = (money*increment)+money;
  15. year+=1;
  16. newbalance = balance;
  17. }
  18.  
  19.  
  20. System.out.println(newbalance);
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment