Question: please solve this question using classes , without arrays please ... Define a class with the following specification: a. The class name is StudyDesk with

 please solve this question using classes , without arrays please ...
Define a class with the following specification: a. The class name isplease solve this question using classes , without arrays please

... Define a class with the following specification: a. The class name is StudyDesk 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 .ength and 70 cm width and false (which means that the table doesn't have drawers), respectively. b. 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. c. 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. e. 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. f. Define a method called displayDesk Details() to display on the screen desk details as in the following sample: Desktop length: 110 Desktop width: 70 Has Drawers: false Write a Java application to do the following: a. Create a object called classroomTable from the class StudyDesk and initialize its length to 100 and width to 40 and no drawers. b. Create another object called drawing Table from the class StudyDesk and initialize its length to 70 and width to 70 and no drawers. c. Check if both tables are equal then display both table details. If not then display the details of the table that has bigger desktop area

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!