Advertisement
GabrielHr00

03. Deposit Calculator

Mar 10th, 2024
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class DepositCalculator {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double depositSum = Double.parseDouble(scanner.nextLine());
  7.         int depositDue = Integer.parseInt(scanner.nextLine());
  8.         double interestPercent = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double monthlyInterest = (depositSum * (interestPercent/100)) / 12;
  11.         double finalSum = depositSum + depositDue * monthlyInterest;
  12.  
  13.         System.out.println(finalSum);
  14.     }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement