Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will create two classes to work together: Housefava and HouseExceptionjava This assignment will help students... remember their ICS 1 1 1 object - creation
You will create two classes to work together: Housefava and HouseExceptionjava
This assignment will help students...
remember their ICS objectcreation and validation skills.
get familiar with how to write and submit assignments in ICS
Housejara
Instance variables and validity restrictions
private int mls; integer ranges between and MLS is a unique listing number for a home when on sale
private int bedrooms; integer ranging from to
private double price; double ranging from to
private String seller, must be at least nonblank characters long
This class must have the following methods
set methods, one per instance variable. points each method These methods should validate the parameters and must call the HouseException if the parameters are invalid. The method names should be as specified below. Parameter names are up to you but the methods should take the parameter data type as indicated below. Follow the coding standards for setmutator methods.
setMilsint mls
setBedroomsint bedrooms
setpricedouble price
setSellerString seller
get methods, points each fach one of these methods as you should know returns the value of an instance variable. You should know what the respective return dat type for each one is
getMils
getBedrooms
getprice
getseller
tostring method. This method returns a String to be printed and takes no parameters, as you learned in ICS Each iteminstance variable should be properly labeled. The price should be properily formatted with dollar sign and two decimals. Failure to do so will result in points deducted.
constructor method that validates the instance variables by calling the set methods. The call to set methods is to make sure that the parameters sent are valid while not duplicating code.
This constructor should take four instance variables as parameters, mls bedrooms, price and seller.
Make sure that the parameters are ALWAYS in the following order int mis, int bedrooms, double price,String seller If parameters are not in this order, points will be deducted Overall program structure, naming conventions and style, following the Java coding standards
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started