Advertisement
CoineTre

Deposit Calculator

Oct 9th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class DepositCalculator {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner (System.in);
  6.         double depositSum = Double.parseDouble (scan.nextLine ());
  7.         int months = Integer.parseInt (scan.nextLine ());
  8.         double interest = Double.parseDouble (scan.nextLine ());
  9.         double sumInMonths = depositSum + months * ((depositSum * (interest/100))/12);
  10.         System.out.printf ("%.2f", sumInMonths);
  11.     }
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement