diff --git a/MP1_CalebFontenot/src/main/java/com/calebfontenot/mp1_calebfontenot/CompoundValue.java b/MP1_CalebFontenot/src/main/java/com/calebfontenot/mp1_calebfontenot/CompoundValue.java index 60f37cc..0a11ad9 100644 --- a/MP1_CalebFontenot/src/main/java/com/calebfontenot/mp1_calebfontenot/CompoundValue.java +++ b/MP1_CalebFontenot/src/main/java/com/calebfontenot/mp1_calebfontenot/CompoundValue.java @@ -11,17 +11,27 @@ 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 - double SavingAmount; - - // Prompt for input - System.out.println(""); - // Compute - - // Print result + // 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); + } } } diff --git a/MP1_CalebFontenot/target/classes/com/calebfontenot/mp1_calebfontenot/CompoundValue.class b/MP1_CalebFontenot/target/classes/com/calebfontenot/mp1_calebfontenot/CompoundValue.class index 46fa95f..879fa6d 100644 Binary files a/MP1_CalebFontenot/target/classes/com/calebfontenot/mp1_calebfontenot/CompoundValue.class and b/MP1_CalebFontenot/target/classes/com/calebfontenot/mp1_calebfontenot/CompoundValue.class differ