Mikie Smith

Greenhorn
+ Follow
since Sep 14, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mikie Smith

Mikie Smith wrote:Organize each of the following sets of items into inheritance hierarchies of classes. Arranging potential classes into inheritance hierarchies

#1
Schedule, Tour Bus, Bus Route, Bus Vehicle, Actual Trip, Regular Schedule Trip, Charter, Unschedule trip, schedule trip, ...
I put the list above in the order below. Not sure whether the inhetitance hierachies is right? It's my best guess.

Schedule
Regularly Scheduled Trip
BusRoute
ActualTrip
Chartered
Scheduled Trip
UnscheduledTrip
BusVehicle
LuxuryBus
TourBus

#2
Edition of book, Copy of book, Volume, Issue of newspaper, Magazine, Work of literature, Newspaper, Issue of magazine, Publication, Chapter, Author, Publisher, Copy of issue of magazine

Here's my guess:
Book
Edition of book
Publication
Publisher
Volume
Author
Chapter
Copy of book
Magazine
Issue of magazine
copy of issue magazine
publisher
New paper
Issue of new paper
publisher

I am stuck with #2. Please help.

Here's my first pass on this

Book
Edition of book
Publication
Publisher
Volume
Author
Chapter
Copy of book
Magazine
Issue of magazine
copy of issue magazine
publisher
New paper
Issue of new paper
publisher

Organize each of the following sets of items into inheritance hierarchies of classes. Arranging potential classes into inheritance hierarchies

#1
Schedule, Tour Bus, Bus Route, Bus Vehicle, Actual Trip, Regular Schedule Trip, Charter, Unschedule trip, schedule trip, ...
I put the list above in the order below. Not sure whether the inhetitance hierachies is right? It's my best guess.

Schedule
Regularly Scheduled Trip
BusRoute
ActualTrip
Chartered
Scheduled Trip
UnscheduledTrip
BusVehicle
LuxuryBus
TourBus

#2
Edition of book, Copy of book, Volume, Issue of newspaper, Magazine, Work of literature, Newspaper, Issue of magazine, Publication, Chapter, Author, Publisher, Copy of issue of magazine

Here's my guess:
Edition of book
Chapter
Publication
Publisher
Volume
Author
Copy of book
Magazine
Issue of magazine
copy of issue magazine
publisher
New paper
Issue of new paper
publisher

I am stuck with #2. Please help.
I guess that all quadrilaterals (which I believe to be poligons of 4 sides) are poligons. so I would say that quadrilateral should be a subclass of polygon.
A rectangle is a particular quadrilateral, so as rectangle are quadrilaterals then the rectangle class should be a subclass of quadrilateral.
So you would have that rectangle is a subclass of quadrilateral and quadrilateral is a subclass of polygon.

My questions are:
What problems could arise by making Quadrilateral and Rectangle subclasses of Polygon? What alternatives are possible? What are the advantages and disadvantages of each alternative?

Thanks.