deyanivanov966

03. Deposit Calculator

Aug 21st, 2020 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class DepositCalculator {
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner scanner = new Scanner (System.in);
  7.  
  8.         double DepositSum = Double.parseDouble(scanner.nextLine());
  9.         int timeDeposit = Integer.parseInt(scanner.nextLine());
  10.         double interestPeryear =  Double.parseDouble(scanner.nextLine());
  11.  
  12.         double Mont = DepositSum * interestPeryear / 100 / 12;
  13.         double Total = DepositSum + timeDeposit * Mont;
  14.  
  15.         System.out.printf("%.2f", Total);
  16.  
  17.     }
  18. }
Add Comment
Please, Sign In to add comment