Question: Hey there. The task is to create a Java class called House and a corresponding driver program to interact with it . Class Attributes: The

Hey there. The task is to create a Java class called House and a corresponding driver program to interact with it.
Class Attributes:
The class should contain the following instance variables:
(String): The address of the house.
(int): The number of bedrooms in the house.
numbathrooms (double): The number of bathrooms in the house (a bathroom can be a half-bathroom,
hence the double data type).
(double): The current market price of the house.
squarefeet (int): The total area of the house in square feet. Constructors:
You should define two constructors for the House class:
1. Default Constructor: This constructor does not take any arguments and initializes address to an empty string, and to zero, price to zero, and to zero.
2. Parameterized Constructor: This constructor takes arguments for address, numBedrooms, numBathrooms, and squareFeet.
Methods:
The class should contain the following methods:
1. Getters and Setters for address,
2. A method calculatePricePerSqFt() that returns the price per square foot (i.e., price divided by Driver Program:
Create a main program (driver program) that does the following:
1. Prompts the user to enter the address, number of bedrooms, number of bathrooms, price, and total area in square feet for a new house.
2. Creates a new object using the parameterized constructor and the user's input.
3. Prints out the house's address, number of bedrooms, number of bathrooms, price, total area, and price per square foot (using the calculatePricePersqFt method).
4. Prompts the user to update the price of the house. Calls the setPrice method with the user's input, then prints out the house's new price and updated price per square foot. Be sure to format the price for currency.
- Deliverables
Upload the following files in a zip folder that you have created:
1. Java files - House.java and your driver file
2. Screenshot of the Console with the code executing
Hey there. The task is to create a Java class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!