Loan OOP Program
Description
This is an OOP program that uses Loan objects to calculate the monthly payment of the loans.The formula to calculate the monthly payment is as follows.
The ADT (abstract data type) is Loan.java.
The client program is LoanCompany.java.
Associated Concepts:
Object Oriented Programming (OOP)
Data member: instance variable
Instance method
Constructor
Getter and getter
toString method
Instance method
Constructor
Getter and getter
toString method
Algorithm:
For Loan class, the class diagram is represented in
UML (Unified Modeling Language) notation.
Client program:
Client program:
Create the mortgage loan object using the overloaded constructor
with the user input data
Use the object reference to call the method to calculate the monthly payment
Print the object's information
Create the car loan object using the overloaded constructor with the hard-coded data
Compare two objects to determine which has the higher monthly payment
Compare two objects to determine which has the higher interest rate
Use the object reference to call the method to calculate the monthly payment
Print the object's information
Create the car loan object using the overloaded constructor with the hard-coded data
Compare two objects to determine which has the higher monthly payment
Compare two objects to determine which has the higher interest rate