Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WhileInvestment {
- public static void main (String args[])
- {
- int year =0;
- double money = 10500;
- double increment = 0.05;
- double balance = 0;
- double newbalance;
- while (year>6)
- {
- balance = (money*increment)+money;
- year+=1;
- newbalance = balance;
- }
- System.out.println(newbalance);
- }
- }
Add Comment
Please, Sign In to add comment