Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package W01FirstStepsInCoding.Exercises;
- import java.util.Scanner;
- public class P03DepositCalculator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //Прочитаме входните данни
- 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
Advertisement