Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P03DepositCalculator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double deposit = Double.parseDouble(scanner.nextLine());
- int months = Integer.parseInt(scanner.nextLine());
- double percent = Double.parseDouble(scanner.nextLine());
- double increase = deposit * (percent / 100);
- double monthlyIncrease = increase / 12;
- double sum = deposit + (months * monthlyIncrease);
- System.out.printf("%.2f", sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement