Question: Complete the following tasks: a. Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include

Complete the following tasks:

a. Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include two overloaded constructors. The default constructor sets each field to 0. The nondefault constructor accepts four parameters—one for each field. Include two overloaded display() methods. The parameterless version displays all the Apartment details. The second version accepts a value that represents a maximum rent and displays the Apartment details only if the Apartment’s rent is no greater than the parameter.

b. Create an application that instantiates several Apartment objects and demonstrates all the methods.

Step by Step Solution

3.46 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Diagram Apartment aptNum num numBeds num numBaths num monthlyRent ... View full answer

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 Logic & Design Questions!