Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Read through all of the classes provided below and decide which ones are similar enough that they would belong in the same class hierarchies.

Instructions

Read through all of the classes provided below and decide which ones are similar enough that they would belong in the same class hierarchies. Then find a meaningful way to build the hierarchies keeping in mind the following concepts:

  • Subclasses should always possess the "ISA" relationship with the corresponding superclass.
  • All commonality should be placed as high in the hierarchy as possible.
  • Although full OO classes will have behaviors, some of the classes provided below do not have any to reduce complication. Do not add behaviors (or any additional attributes) to these classes.
  • You should add superclasses as needed. If one class inherits from another, clearly indicate the class that is being inherited from and clearly indicate which attributes and behaviors are being inherited and which are not.

Create a Word document for your refactored classes titled Lab2a_yourlastname.docx. Once you have completed the lab, upload this file to Canvas.

Classes to refactor:

Class name: Student

AttributesBehaviors
agesleep()
addressattendClass()
workEthicstudy()
majorparty()


Class name: Professor

AttributesBehaviors
agesleep()
addressattendClass()
tenureprepareForClass()
degreepontificate()

Class name: DigitalMedia

Attributes
title
price
format


Class name: DVD

Attributes
title
price
format
numberOfBytes
storageCapacity
type
layers


Class name: eBook

Attributes
title
price
format
numberOfBytes
numberOfChapters
author

Class name: youtubeVideo

Attributes
title
price
format
numberOfBytes
resolution
length


Class name: Magazine

Attributes
title
price
font
numberOfPages
editor
frequencyOfPublication


Class name: Book

Attributes
title
price
font
numberOfPages
ISBN
publisher

Class name: Newspaper

Attributes
title
price
font
numberOfPages
journalist
sections

Step by Step Solution

3.36 Rating (165 Votes )

There are 3 Steps involved in it

Step: 1

Sending you two code snippets The first one is the main code containing all the functions The se... 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

Fundamentals of Investments Valuation and Management

Authors: Bradford D. Jordan, Thomas W. Miller

5th edition

978-007728329, 9780073382357, 0077283295, 73382353, 978-0077283292

More Books

Students also viewed these General Management questions