Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

1. Select the job or jobs to be analyzed.

Answered: 1 week ago