Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The zip file LabInheritStarter contains the code skeleton for this lab. Write a class Room. A Room class contains an int instance variable for the

The zip file LabInheritStarter contains the code skeleton for this lab. Write a class Room. A Room class contains an int instance variable for the area (in square feet) of the room one constructor that takes the area of the room as a parameter an accessor, int getSquareFeet() that returns the area of the room an accessor, int getCapacity() that returns the capacity of the room. The capacity is given by dividing the square feet by 9 (using integer division). an accessor, String toString() that returns the square feet and capacity of the room. Write a class Classroom that extends Room. A Classroom class contains an int instance variable for the number of chairs in the classroom a constructor that takes the area of the classroom as a parameter a constructor that takes the area of the classroom and the number of chairs as parameters getter and setter for chairs an override for getCapacity. The capacity of a classroom is the number of chairs. an accessor, String toString() that returns the square feet and capacity of the room as well as the number of chairs. Write a class Elevator that extends Room. An Elevator class contains an int instance variable for the current floor of the elevator a constructor that takes the area of the elevator as a parameter a mutator void up(int floors) that increases the current floor by the parameter a mutator void down(int floors) that decreases the current floor by the parameter an accessor String toString() that returns the square feet and capacity of the elevator, as well as its current floor.

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

What is profit and loss appropriation account?

Answered: 1 week ago

Question

Discuss all branches of science

Answered: 1 week ago