// TestMortgageClass.java: Demonstrate using the Mortgage class
//package Chapter5;

//import Chapter2.MyInput;

public class TestMortgageClass
{
  // Main method
  public static void main(String[] args)
  {
    // Enter interet rate
    System.out.println(
      "Enter yearly interest rate, for example 8.25: ");
    double interestRate = MyInput.readDouble();

    // Enter years
    System.out.println(
      "Enter number of years as an integer, for example 5: ");
    int year = MyInput.readInt();

    // Enter loan amount
    System.out.println(
      "Enter loan amount, for example 120000.95: ");
    double loan = MyInput.readDouble();

    // Create Mortgage object
    Mortgage m = new Mortgage(interestRate, year, loan);

    // Display results
    System.out.println("The monthly pay is " + m.monthlyPay());
    System.out.println("The total paid is " + m.totalPay());
  }
}


