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