Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this Programming Assignment you will create the Apartment class with the necessary attributes and methods to properly meet the following specification. The constructor for
In this Programming Assignment you will create the Apartment class with the necessary attributes and methods to properly meet the following specification. The constructor for the Apartment class requires exactly four parameters in this order: 1. integer number of bedrooms 2. integer number of square feet 3. Boolean to indicate if it is furnished or not 4. string address The constructor will also automatically compute and store a (default) value for each of the following using the formula given maximum occupancy number of bedrooms + 1 deposit - square feet 0.8 rounded to nearest dollar rent 400.0number of bedrooms300.0 Required Methods (Note that Arguments column does not specifically list sel Method Description See above init setDeposit setRent setMaxOcc setFurnished Arguments See above deposit rent maxOccupancy True/False Set a different deposit amount. If 0, reset to default deposit Set a different rent amount. If 0, reset to default rent Set a different max occupancy. If 0, reset to default numbeir Change furnished instance variable. Also forces rent and deposit to their default values and then multiplies these values by 1.15 and 1.3 respectively, if furnished. Return number of bedrooms getBedRooms getSqft getAddress getDeposit getRent getMaxOcc getFurnished Return number of square feet Return the address Return the current value of the deposit Return the current value of the rent Return the current value of maximum occupancy Return the Boolean value indicating if the apartment is furnished mul factor Multiply both rent and deposit by factor, round to the nearest dollar and store these new values Add amount to rent, round to the nearest dollar and store in rent amount otherApt otherApt otherApt otherApt otherApt otherApt It Compare the number of bedrooms of this apt and otherApt Compare the number of bedrooms of this apt and otherApt Compare the number of bedrooms of this apt and otherApt Compare the number of bedrooms of this apt and otherApt Compare square feet of this apt and otherApt ne Compare square feet of this apt and otherApt Return a string to match the printed versions given in following examples
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