Sampling of How You Make A Class
 
Every POS 406 course folks get curious about how to make a class. The subject is not in the objectives of the course. However I include this post for your edification and you can ask more about it in Main if you want. This is not a requirement of assignments.

 There is learning to use pre-built classes like String and Math. Then there is making your own classes. This will give you a glimpse of making your own class. Notice the class does not have a main method since it is not a starting class.

For the mortgage assignment you might build a class to compute the payment and then use the class in other classes. Here is what the shell might look like.
 
class MortgagePaymentCalculator{
    // Fields private to the class
    private float cMonthlyPayment;
    private float cPrinciple;
    private int  cMonths;
    private float cRate;
    // Class constructor method
    MortgagePaymentCalculator(float principle, float rate,  int months)
    {
        // Set the class fields to the arguments.
        cRate = rate;
        cPrinciple = principle;
        cMonths = months;
        // Compute the monthly payment for the
        // class field cMonthlyPayment.
        computeMonthlyPayment();
    }
    // Method to return the monthly payment
    float getMonthlyPayment()
    {
       return cMonthlyPayment;
    }
    // Computes the monthly payment but not accessible outside the class.
    private computeMonthlyPayment()
    {
        // Compute cMonthlyPayment here using the
        // cPrinciple, cMonths and cRate fields.
 
    }
 
}
 
Here is how it might appear in use
 
class MortgageCalculatorTester
{
    public static void main(String [] args)
    {
        // Construct a MortgagePaymentCalculator object
        // variable named myMortgage
        MortgagePaymentCalculator myMortgage
            = new MortgagePaymentCalculator(100000,.0575,30);
        // Display the myMorgage monthlyPayment.
        System.out.println( myMortgage.getMonthlyPayment() );
    }
 
}