ESRM100 Be'er Yaakov Talmudic Seminary Train Scenarion

User Generated

Zbaxrl123

Programming

ESRM100

Beer Yaakov Talmudic Seminary

Description

Pick one of the following scenarios and

  • model using at least 5 classes: one parent, two children, and two grandchildren of one of the child classes.
  • Provide at least one field and one method that compellingly differentiates each class from the others.
  • Do not include constructors, getters, or setters in your description.

Scenarios - lots of them spring to mind, but I don't want the list to be too long. In this way, you can compare your ideas with those of other students, and I encourage to consider what other students have posted, you are also encouraged to make suggestions of other's postings and make additional postings updating your own ideas in light of the suggestions by others.

  1. An airplane
  2. A train
  3. An e-commerce company (eg, Amazon)
  4. A city government
  5. An airline (aspects of an entire company)
  6. A government organization (eg, EPA, Defense)
    1. NOTE: A general is not a kind of private, nor is a private a kind of general, for example.
    2. Also, a general is not a kind of Defense Department
    3. THUS: not all hierarchies are class hierarchies!

Note: This problem is NOT asking for a full implementation of these classes - a UML diagram, or similar level of detail, is adequate.

You will find many of the items in the following helpful throughout this class:

I would emphasize the following kinds of relationships among classes:

is-a

parent/child relationship in a class hierarchy
perhaps better to use the phrase "is a kind of", as in "a Private is a kind of Soldier" or "a SportsCar is a kind of Car"

is-somea data structure in which all the elements have the same type.
This is the place where one should use generic classes.
This will not be the case in our project since we have a structure of Cave -> Party -> Creature -> Artifact and Treasure.
has-aan attribute (field) of one class inside another
has-some

a 1-to-n relationship,
in our case a Party will have may Creatures, and a Creature will have many Artifacts and will also have many Treasures

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached.

Running head: Class Hierarchy For a Train Scenario

Class Hierarchy For a Train Scenario

Name:
Institution:
Date:

1

Running head: Class Hierarchy For a Train Scenario

2

Question
Model a training scenario using at least five classes: one parent, two children and two grandchildren
of one of the child classes. Provide at least one field and one method that compellingly differentiates
each class from the others.

Description of ...


Anonymous
Really helpful material, saved me a great deal of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags