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