Question: Assignment 1. Write a Java class called ResidenceListing, representing a house (residence) that is listed for sale. Add these members: (a) Fields to represent the

Assignment 1. Write a Java class called ResidenceListing, representing a house (residence) that is listed for sale. Add these members: (a) Fields to represent the house's number of bedrooms (integer), number of bathrooms (a house can have fractions of a bathroom; a room with only a sink and toilet is considered "half a bathroom); street address (ex: 42 Wallaby Way); city (ex: Sydney); integer number of square feet of area (ex: 1090); and sale price in integer dollars. A constructor that takes one parameter for each of the fields, and initializes the fields with the corresponding parameters. (c) Writer accessors ("getters) for all of the class fields. (d) Write a mutator ("setter) for the sale price only; this void method should take a new sale price as its parameter, and change the field to reflect the new price. (e) Write a method pricePerSquareFoot, which returns the square foot area divided by the sale price. Be careful of integer division. How to Get Credit Show me: 1. The source code for your ResidenceListing class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
