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 scan = new Scanner (System.in);
- double depositSum = Double.parseDouble (scan.nextLine ());
- int months = Integer.parseInt (scan.nextLine ());
- double interest = Double.parseDouble (scan.nextLine ());
- double sumInMonths = depositSum + months * ((depositSum * (interest/100))/12);
- System.out.printf ("%.2f", sumInMonths);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement