Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lessons;
- //write pgm to calculate monthly retirement contribution
- //calculate a 5%,8%,10% cont of $6000 a month
- public class Contribution
- {
- public static void main(String[] args)
- {
- double income = 6000.0, FiveP = .05, EightP = .08, TenP = .1;
- double FivePC, EightPC, TenPC;
- FivePC = income*FiveP;
- EightPC = income*EightP;
- TenPC = income*TenP;
- System.out.println("monthly pay: $"+income
- +"\nFive Percent Contribution of total monthly income: $"+ FivePC
- +"\nEight Percent Contribution of total monthly income: $"+ EightPC
- +"\nTen Percent Contribution of total monthly income: $"+ TenPC);
- }
- }
Add Comment
Please, Sign In to add comment