Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-type: String -length: double -width: double -num Floors: int Building ( type: String, length: double, width: double, numFloors: int): + getType( ): String +getLength( ):

image text in transcribed
-type: String -length: double -width: double -num Floors: int Building ( type: String, length: double, width: double, numFloors: int): + getType( ): String +getLength( ): double +getWidth( ): double +getNumFloors(): double +setLength(length: double): void +setWidth (width: double): void +setNumFloors (num Floors: int): void +getArea(): double *getBuildingDetails(): void The Building class is an abstract superclass and it holds features that are common to all of its subclasses. All building have a length, a width and the number of floors. Please only code for the accessor and mutator methods that appear in the UML diagrams. There is a utility method called getArea() which will determine the area of each building based on the its length, width, and number of floors. This method will return a double value rounded to one decimal place. The getBuilding Details( ) method is an abstract method which will be implemented by each sub class of Building. Each building has its own unique descriptions so we'll over-ride this method in each sub class. Warehouse -percentStorage: double -numRooms: int Warehouse( length: double, width: double, num Floors: int, pStorage: double, rooms: int) Warehouse (type: String, length: double, width: double, numFloors: int, pStorage: double, rooms: int) +getPercentStorage(): double +getRooms(): int +setPercentStorage(pStorage: double): void +setNumRooms(rooms: int): void +getBuildingDetails (): void The Warehouse class is a sub class of Building and represents more concrete type of structure. These buildings are separated into storage and offices, so we note the number of rooms there along with the amount of building that is used for storage. It has a 5-arg and a 6-arg constructor. The 5-arg constructor is used when you instantiate a new Warehouse. The 6-arg constructor comes into play when you create a sub class object to the warehouse. The getBuildingDetails() method implementation for this class will simply describe this building

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_2

Step: 3

blur-text-image_3

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

Essentials Of General Management In Africa

Authors: Lemayon Lemilia Melyoki, Betty Jane Punnett

1st Edition

0367435195, 978-0367435196

More Books

Students also viewed these General Management questions

Question

2. When is the job to be completed?

Answered: 1 week ago

Question

What are the steps involved in the HR planning process?

Answered: 1 week ago