
Use Java Programming Language
Create a Loan Account Hierarchy consisting of the following classes: LoanAccount, CarLoan, PrimaryMortgage , UnsecuredLoan, and Address. Each class should be in it's own .java file.
The LoanAccount class consists of the following properties:
- principal- the original amount of the loan.
- annualInterestRate - the annual interest rate for the loan. It is not static as each loan can have it's own interest rate.
- months - the number of months in the term of the loan, i.e. the length of the loan.
and the following methods:
- a constructor that takes the three properties as parameters.
- calculateMonthlyPayment() - takes no parameters and calculates the monthly payment using the same formula as Assignment 1.
- getters for the three property variables.
- toString() - displays the information about the principle, annualInterestRate, and months as shown in the example output below.
The CarLoan class which is a subclass of the LoanAccount class and consists of the following property:
- vehicleVIN - the VIN number of the car, as a string.
and the following methods:
- constructor that accepts the three parameters of the LoanAccount class and the vehicleVIN.
- toString() - displays the information about the VIN number as shown in the example output below.
The PrimaryMortgage class which is a subclass of LoanAccount and consists of the following properties:
- PMIMonthlyAmount - the amount of the Primary Mortgage Insurance which is required for all mortgages where the down payment is not at least 20% of the home value.
- Address - the address of the real estate and is an object of the Address class.
and the following methods:
- constructor that accepts the three parameters of the LoanAccount class, the PMIMonthlyAmount, and the Address object containing the address.
- toString() - displays the information about the PMIMonthlyAmount and Address as shown in the example output below.
The UnsecuredLoan class which is a subclass of LoanAccount and has no additional properties and has the following methods:
- constructor that accepts the three parameters of the LoanAccount class.
- toString() - displays the information that it is an Unsecured Loan as shown in the example output below.
The Address class which consists of the following properties:
- street - the house number and street part of the address.
- city - the city where it is located.
- state - the state.
- zipcode - and the zipcode.
and the following methods:
- constructor which accepts the values for the four properties as parameters.
- getters for each property.
- toString() - display the address information as shown in the example below.
Your code in the subclasses should call methods in the super classes whenever possible to reduce the amount of code in the subclasses and utilize the code already developed in the super classes.
Use the following code in your main function to test your classes, just copy and paste it into your main method:
CarLoan carLoan = new CarLoan(25000.00, 4.25, 72, "IRQ3458977");
Address propertyAddress = new Address("321 Main Street", "State College", "PA", "16801");
PrimaryMortgage propertyLoan = new PrimaryMortgage(250000.00, 3.1, 360, 35.12, propertyAddress);
UnsecuredLoan unsecuredLoan = new UnsecuredLoan(5000.00, 10.75, 48);
//Print out the load information for each loan using the toString() method.
System.out.format("%n%s%s%s%n", carLoan, propertyLoan, unsecuredLoan);
The output from your program should look like the following:
run:
Car Loan with:
Principal: $25000.00
Annual Interest Rate: 4.25%
Term of Loan in Months: 72
Monthly Payment: $393.98
Vehicle VIN: IRQ3458977
Primary Mortgage Loan with:
Principal: $250000.00
Annual Interest Rate: 3.10%
Term of Loan in Months: 360
Monthly Payment: $1067.54
PMI Monthly Amount: $35.12
Property Address:
321 Main Street
State College, PA 16801
Unsecured Loan with:
Principal: $5000.00
Annual Interest Rate: 10.75%
Term of Loan in Months: 48
Monthly Payment: $128.62

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- Please help with the following: C# .NET change the main class so that the user is the one that as to put the name a driver class that prompts for the person’s data input, instantiates an object of class HealtProfile and displays the patient’s information from that object by calling the DisplayHealthRecord, method. MAIN CLASS---------------------- static void Main(string[] args) { // instance of patient record with each of the 4 parameters taking in a value HeartRates heartRate = new HeartRates("James", "Kill", 1988, 2021); heartRate.DisplayPatientRecord(); // call the method to display The Patient Record } CLASS HeartRATES------------------- class HeartRates { //class attributes private private string _First_Name; private string _Last_Name; private int _Birth_Year; private int _Current_Year; // Constructor which receives private parameters to initialize variables public HeartRates(string First_Name, string Last_Name, int Birth_Year, int Current_Year) { _First_Name = First_Name;…arrow_forwardThere are two types of data members in a class: static and non-static. Provide an example of when it might be useful to have a static data member in the actual world.arrow_forwardClasses: Write a Person class that has these attributes: person_ID, first and last names, and age Default and overloaded constructors Accessors and mutators equals method toString method (make this virtual if C++, don't forget to prep the class for polymorphism) Inheritance: Create a child class to Person called Student: Attributes: GPA and status (freshman, sophomore, junior, senior, graduate, graduated). Make sure you have appropriate accessor/mutator methods Create another child class to represent Faculty. This class will have faculty rank and length of service as attributes along with an office location. Again, add methods as needed. Application Create an application that displays a menu that allows users to add students or faculty, or print either one or exit. Deliverable: Submit your source code and classes on Github (you will be supplied an account) You will also submit a Word document and your code on Canvas. In the document you iwll write a summary of your design…arrow_forward
- Number Guessing Program using java: The player has to guess a number given in between a range. If the guessed number is right, the player wins else, loses. It also has the concept of limited attempts where the player has to guess the number within the limited attempts given. Note: It must incorporates the following OOP components: - Classes - Objects - Constructors - Class Variable - Object Methodarrow_forwardarrow_back Starting Out With Visual C# (5th Edition) 5th Edition Chapter 11, Problem 1PP arrow_back_ios PREVIOUS NEXT arrow_forward_ios Question share_out_linedSHARE SOLUTION Chapter 11, Problem 1PP Program Plan Intro Employee and ProductionWorker Classes Program plan: Design the form: Place a three text boxes control on the form, and change its name and properties to get the employee name, number, and hourly pay rate from the user. Place a four label boxes control on the form, and change its name and properties. Place a two radio buttons control on the form, and change its name and properties. Place a one group box control on the form, and change its name and properties. Place a command button on the form, and change its name and properties to retrieve the object properties and then display the values into label box. In code window, write the code: Program.cs: Include the required libraries. Define the namespace “Program11_1”. Define a class “Program”. Define a constructor for the…arrow_forwardclass Student: def __init__(self, id, fn, ln, dob, m='undefined'): self.id = id self.firstName = fn self.lastName = ln self.dateOfBirth = dob self.Major = m def set_id(self, newid): #This is known as setter self.id = newid def get_id(self): #This is known as a getter return self.id def set_fn(self, newfirstName): self.fn = newfirstName def get_fn(self): return self.fn def set_ln(self, newlastName): self.ln = newlastName def get_ln(self): return self.ln def set_dob(self, newdob): self.dob = newdob def get_dob(self): return self.dob def set_m(self, newMajor): self.m = newMajor def get_m(self): return self.m def print_student_info(self): print(f'{self.id} {self.firstName} {self.lastName} {self.dateOfBirth} {self.Major}')all_students = []id=100user_input = int(input("How many students: "))for x in range(user_input): firstName = input('Enter…arrow_forward
- Portfolio Instructions: You are working for a financial advisor who creates portfolios of financial securities for his clients. A portfolio is a conglomeration of various financial assets, such as stocks and bonds, that together create a balanced collection of investments. When the financial advisor makes a purchase of securities on behalf of a client, a single transaction can include multiple shares of stock or multiple bonds. It is your job to create an object-oriented application that will allow the financial advisor to maintain the portfolios for his/her clients. You will need to create several classes to maintain this information: Security, Stock, Bond, Portfolio, and Date. The characteristics of stocks and bonds in a portfolio are shown below: Stocks: Bonds: Purchase date (Date) Purchase date (Date) Purchase price (double)…arrow_forwardComputer programmingarrow_forwardExercise 1-Account class • Design a class named Account that contains : • A private int data field named id for the account • A private double data field named balance for the account • A privet Date data field named dateCreated that stores the date when the account was created • A no-arg constructor that creates a default account • A constructor that creates an account with the specified id and initial balance • The getters (i.e., accessors) and setters (i.e., mutators) methods for id and balance • The getter method for dateCreated • A method named withdraw that withdraws a specified amount from the account • A method named deposit that deposits a specified amount to the accountarrow_forward
- It is possible to express the relationship that exists between classes and objects.arrow_forwardJAVA Programming Problem 3 - Book A Book has such properties as title, author, and numberOfPages. A Volume will have properties such as volumeName, numberOfBooks, and an array of book objects (Book [ ]). You are required to develop the Book and Volume classes, then write an application (DemoVolume) to test your classes. The directions below will give assistance. Create a class called Book with the following properties using appropriate data types: Title, Author, numberOfPages, Create a second class called Volume with the following properties using appropriate data types: volumeName, numberOfBooks and Book [ ]. The Book [ ] contains an array of book objects. Directions Create a class called Book with the following properties using appropriate data types: Title, Author, numberOfPages, The only methods necessary in the Book class, for this exercise, are the constructor and a toString(). Create a second class called Volume with the following properties using appropriate data types:…arrow_forwardINVENTORY CLASS You need to create an Inventory class containing the private data fields, as well as the methods for the Inventory class (object). Be sure your Inventory class defines the private data fields, at least one constructor, accessor and mutator methods, method overloading (to handle the data coming into the Inventory class as either a String and/or int/float), as well as all of the methods (methods to calculate) to manipulate the Inventory class (object). The data fields in the Inventory class include the inventory product number (int), inventory product description (String), inventory product price (float), inventory quantity on hand (int), inventory quantity on order (int), and inventory quantity sold (int). The Inventory class (java file) should also contain all of the static data fields, as well as static methods to handle the logic in counting all of the objects processed (counter), as well as totals (accumulators) for the total product inventory and the total product…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





