0% found this document useful (0 votes)
44 views3 pages

Class Assignment 5 September

The document outlines a series of questions related to class diagrams, object diagrams, and use case diagrams in software design. It includes tasks such as creating diagrams for the dining philosopher problem, an air transportation system, and a polygon, as well as explaining concepts like metadata and different types of associations. Additionally, it asks for categorization of relationships and the creation of a use case diagram for an online travel agent.

Uploaded by

sahil141530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views3 pages

Class Assignment 5 September

The document outlines a series of questions related to class diagrams, object diagrams, and use case diagrams in software design. It includes tasks such as creating diagrams for the dining philosopher problem, an air transportation system, and a polygon, as well as explaining concepts like metadata and different types of associations. Additionally, it asks for categorization of relationships and the creation of a use case diagram for an online travel agent.

Uploaded by

sahil141530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Q1. Prepare a class diagram for the dining philosopher problem.

There are 5 philosophers


and 5 forks around a circular table. Each philosopher has access to 2 forks, one on either
side. Each fork is shared by 2 philosophers. Each fork may be either on the table or in use by
one philosopher. A philosopher must have 2 forks to eat.

Q2. Figure given is a partially completed class diagram of an air transportation system.
Multiplicity has been omitted. Add multiplicity to the diagram. Demonstrate how multiplicity
decisions depend on your perception of the world. Add association names to the unlabeled
associations in the given Figure.

Q3. For the below class diagram draw an object diagram, for person: John, Tom, and Mary
working in TCS company, while a person Ravi is working in IBM.

Q4. Construct a class diagram where you should properly use association end names and
not introduce a separate class for each reference.
Q5. What is the difference between ordered, bags, and sequence association? Provide an
example.

Q6. Prepare a class diagram for a polygon. Explain your multiplicity decisions. Each point
has an x coordinate and a y coordinate. What is the smallest number of points required to
construct a polygon? Does it make a difference whether or not a point may be shared
between polygons? Your answer should address the fact that points are ordered.

Q7. With respect to the previous question, draw an Object diagram for a polygon that
happens to be a square.

Q8. Draw a class diagram for the following:

FullTimeIndividualContributor is both FullTimeEmployee and IndividualContributor and


combines their features. FullTimeEmployee and PartTimeEmployee are disjoint; each
employee must belong to exactly one of these. Similarly, Manager and IndividualContributor
are also disjoint and each employee must be one or the other.

Q9. What is metadata? Draw a class diagram for the following:

A car model has a model name, year, base price, and a manufacturer. Some examples of car
models are a 1969 Ford Mustang and a 1975 Volkswagen Rabbit. A physical car has a serial
number, color, options, and an owner. As an example of physical cars, John Doe may own a
blue Ford with serial number 1FABP and a red Volkswagen with serial number 7E81F.

Identify the metadata and data in the above scenario.

Q10. Categorize the following relationships into generalization, aggregation, or association.


Beware, there may be n-ary associations in the list, so do not assume every relationship
involving three or more classes is a generalization. Explain your answers.

a. A country has a capital city.

b. A dining philosopher uses a fork.

c. A file is an ordinary file or a directory file.


d. Files contain records.

Q11. You are interacting with an online travel agent and encounter the following use cases.
Prepare a use case diagram, using the generalization and include relationships.

■ Purchase a flight. Reserve a flight and provide payment and address information.

■ Provide payment information. Provide a credit card to pay for the incurred charges.

■ Provide address. Provide mailing and residence addresses.

■ Purchase car rental. Reserve a rental car and provide payment and address information.

■ Purchase a hotel stay. Reserve a hotel room and provide payment and address
information.

■ Make a purchase. Make a travel purchase and provide payment and address information.

You might also like