Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java 2. a) Create an abstract class called Room. This class has 3 attributes: xCoordinate yCoordinate zCoordinate . You will have to decide the type

image text in transcribed

java

2. a) Create an abstract class called Room. This class has 3 attributes: xCoordinate yCoordinate zCoordinate . You will have to decide the type of these attributes. The Room class also has an abstract method called open, and another abstract method called close. b) Create two concrete classes that are children of the Room class, called Kitchen and Bedroom. A concrete class (representing concrete rooms) has 2 additional attributes in addition to the attributes of its parent class. Also, when a concrete class implements the open method, it contains code to print the message Room [insert number here) opened! and when it implements the close method, it contains code to print the message Room (insert number here) closed

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