Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DepositCalculator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double depositSum = Double.parseDouble(scanner.nextLine());
- int depositDue = Integer.parseInt(scanner.nextLine());
- double interestPercent = Double.parseDouble(scanner.nextLine());
- // сума = депозирана сума + срок на депозита * ((депозирана сума * годишен лихвен процент ) / 12)
- double annualInterest = depositSum * interestPercent/100;
- double monthlyInterest = annualInterest / 12;
- double totalSum = depositSum + depositDue * monthlyInterest;
- System.out.println(totalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement