/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.calebfontenot.mp1_calebfontenot;

import java.util.Scanner;

/**
 *
 * @author caleb
 */
public class CompoundValue {

    public static void main(String[] args) {
        // Create Scanner
        Scanner input = new Scanner(System.in);

        // Define vars
        int counter;
        double SavingAmount;
        double InterestRate;

        // Prompt for input
        System.out.print("Enter monthly saving amount: ");
        SavingAmount = input.nextDouble();

        // Compute and Print result
        InterestRate = 0.05 / 12;
        SavingAmount = SavingAmount * (1 + InterestRate);
        System.out.println("The account is " + SavingAmount + " after month 1");
        for (counter = 2; counter <= 6; counter++) {
            SavingAmount = (100 + SavingAmount) * (1 + InterestRate);
            System.out.println("The account is " + SavingAmount + " after month " + counter);
        }
    }
}
