Question: Define a class with the following specification: The class name is Study Desk with three private instance variables: toplength (of the type double) and topWidth

 Define a class with the following specification: The class name is

Define a class with the following specification: The class name is Study Desk with three private instance variables: toplength (of the type double) and topWidth (of the type double), and hasDrawers (with type boolean) with default values of 110 centimeters for its top length and 70 cm width and false (which means that the table doesn't have drawers), respectively. Write two constructors for this class. A default constructor that takes no arguments and which initializes all the data members to the default values specified in step a. The second constructor takes three arguments for length, width and hasDrawers of the StudyDesk. Provide mutator (set) methods for length and width data members. d. Define a method called calcTopArea() that returns the area of the desk surface area. Define a method called equals that returns true if the two tables have the same desktop area and then both have the same boolean value for hasDrawers data member. Define a method called displayDeskDetails() to display on the screen desk details as in the following sample: f. Desktop length: Desktop width: Has Drawers: 110 70 false

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!