Question: QUESTION 5 For this question, please submit a java file Create a class named House and give it 3 attributes: price, number OfRooms, & sqFeet.

QUESTION 5 For this question, please submit a java file Create a class named House and give it 3 attributes: price, number OfRooms, & sqFeet. Create a constructor that initializes each attribute. Then, create a getter and setter for each attribute. Create a toString() method that returns a string representation of the object in this format: 2400 sq foot home with 4 bedrooms for $1000000.00 Create another method called calculateSqMeters() which calculates the square meters of the house and returns the result. (1 square foot = 0.092903 sq meters) Now create a class called Main that has a main method. Inside of the main method, create 3 House objects and construct them with whatever values you would like. Create an ArrayList of type House called houseList and store each House object into the houseList. Iterate through the houseList and print each object. (Hint: use a for loop for this) Extra Credit (5 points) Create a method called calculateMonthly Mortgage Price int n) inside of the House class. This method should calculate a monthly mortgage price based on the price of the house. The function should have an integer parameter n, and return the monthly mortgage price on the house. The code for calculating a monthly mortgage price is: double M =P*1.004167*Math.pow(1.004167,n)/(Math.pow(1.004167,n)-1)); (Copy and paste this into the method) Where P is the price of the house, n is the number of months the mortgage will last, and M will result in the price per month for a mortgage. Extra Credit (3 points) Add proper JavaDoc comments to the calculateSqMeters() method and the calculate Monthly MortgagePrice(int n) method Attach File Browse My Computer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
