Question: An Intro Java Problem, please help! Write a House Class With User Input 1. Create a new class named in the format PX_LastName_FirstName_House 2. At

An Intro Java Problem, please help! Write a House Class With UserInput 1. Create a new class named in the format PX_LastName_FirstName_House 2.At the top of your program, write a multi-line comment stating oAn Intro Java Problem, please help!

Write a House Class With User Input 1. Create a new class named in the format PX_LastName_FirstName_House 2. At the top of your program, write a multi-line comment stating o Your name o Intro Java o Lab 2b - House With Input o Period o Date 3. Declare instance variables to keep track of o number of doors o number of windows o number of bedrooms o asking price (cost of the house set by house owner) 4. Add two constructors 1. A default constructor that initializes the attributes as follows: 10 doors 8 windows 3 bedrooms 435000 asking price 2. A second constructor that accepts parameters for number of doors, windows, bedrooms, and asking price 5. Add "getter methods" o A method that returns the number of doors O A method that returns the number of windows O A method that returns the number of bedrooms A method that returns the asking price 7. Add these other methods 01 /** Calculate and return the market value for this house 02 Market value is $300,000 plus $55,000 per bedroom 03 plus $3,000 per window */ 04 public double calculateMarketValue() { 05 // Add your code here 06 } 07 08 09 // Adds more windows to the house 10 public void addWindows (int num) { 11 // Add your code here 12 } 13 14 15 // Adds more doors to the house 16 public void addDoors (int num) { 17 // Add your code here 18 } 19 20 21 /** Adds more bedrooms to the house 22 Each new bedroom adds one new door and one new window */ 23 public void addBedrooms (int num) { 24 // Add your code here 25 } 26 27 28 /** returns true if the asking price is less than the 29 calculated market value and false otherwise */ 30 public boolean isBelowMarketValue() { 31 // Add your code here 32 } 33 34 35 /** returns a String specifying this house's 36 number of bedrooms 37 - market value 38 asking price */ 39 public String toString() { 40 // Add your code here 41 } Write a Driver 1. Write a driver to test your House class using user input. Name your driver using the format PX_LastName_FirstName_HouseDriver. o Create a default house and print out the result of calling toString() on the house. o Print out the number of doors, number of windows, number of bedrooms, and asking price using the getters o Prompt the user for the number of number of doors, windows and bedrooms, and for the asking price. o Create a house using the values the user entered. o Print out the result of calling toString() on the house created by the user. o Print out whether the house is above, below or at market value o Add 1 bedroom to the house the user created. o Prompt the user for a new asking price. o Change asking price for the user created house using the setter. o Print out "After adding a bedroom: " o Print out the result of calling toString() on the house created by the user. o Print out whether the house is above, below or at market value Here is some sample output (your wording can vary) A 3 bedroom house with a market value of $489000.0 is for sale with asking price $435000 Doors: 10 Windows: 8 Bedrooms: 3 Asking Price: $435000.0 How many doors do you want? 5 How many windows do you want? 8 How many bedrooms do you want? 2 What is your asking price? 378000 A 2 bedroom house with a market value of $434000.0 is for sale with asking price $378000 The asking price is below market value. What is your new asking price? 567000 After adding a bedroom: A 3 bedroom house with a market value of $492000.0 is for sale with asking price $567000 The asking price is above market value

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 Databases Questions!