Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package L01_FirstStepsInCoding_EXC;
- import java.util.Scanner;
- public class P03_DepositCalculator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. Прочитаме входните данни
- //2. Пресмятаме печалбата за месец
- //3. Пресметнем колко е цялата сума за всички месеци
- //4. Принтираме резултата
- double depositSum = Double.parseDouble(scanner.nextLine());
- int months = Integer.parseInt(scanner.nextLine());
- double interestRate = Double.parseDouble(scanner.nextLine());
- double profitPerMonth = (depositSum * ( interestRate / 100)) / 12;
- double totalSum = depositSum + profitPerMonth * months;
- System.out.println(totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment