Class Diagram Practice Questions
Class Diagram Practice Questions
SOFTWARE DEVELOPMENT
Class/object diagram practice questions
Identify the relationships as associations, aggregations,
compositions or generalizations. Also determine
multiplicity.
A person plays for a team in a certain year.
A country has a capital city
A dining philosopher is using a fork
A file is an ordinary file or a directory file
Files contains records
A polygon is composed of an ordered set of points
Modems and keyboards are I/O devices
A student takes a course from a professor
Prepare class diagrams that include the following
classes and identify at least 10 relationships between
them. Include attributes of classes, operations and
multiplicity.
School, playground, principal, school board, classroom,
book, student, teacher cafeteria, rest room, computer, desk,
chair, ruler, door, swing.
File system, file, directory, file name, ASCII file, executable
file, directory file, disk drive, track, sector
Sink, freezer, refrigerator, table, light, switch, window, smoke
alarm, burglar alarm, cabinet, bread, cheese, ice, door,
kitchen
Consider modeling a system that tracks results of
matches being played in a league like the English
premier league for football or IPL for cricket. The
league has a number of teams. Each team
comprises of players. The league has one season
per calendar year. Every season, matches are
conducted between teams. Every match is played at
a venue.
Model a class diagram for a banking system. In the
bank, each customer has one or more bank
accounts. Bank accounts are of two types, a savings
account and a checking account. The customer can
have a debit card against his savings account. The
customer can perform multiple types of transactions
against his accounts. These transactions are mainly
of two types, deposit and withdrawal transactions.
Deposits can be made via cash or cheque.
Withdrawals can be made via the debit card or
cheque.