Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P03DepositCalculator {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double deposit = Double.parseDouble(scanner.nextLine());
- int months = Integer.parseInt(scanner.nextLine());
- double percent = Double.parseDouble(scanner.nextLine());
- // double result = deposit + months *
- // ((deposit * (percent / 100)) / 12);
- double increase = deposit * (percent / 100);
- double monthlyIncrease = increase / 12;
- double result = deposit + months * monthlyIncrease;
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement