Government College University Lahore
Department of Computer Science
FINAL TERM EXAMINATION Object Oriented Analysis and Design
Roll #: BSCS - Name: Section_______
Time Allowed : 180 mins SUBJECTIVE Marks 60
ATTEMPT ANY (5) QUESTIONS. EACH QUESTION CARRY EQUAL MARKS
1. Categorize the following relationship into generalization, aggregation, composition and
association. (12)
Files contain records.
A drawing object is text, a geometrical object or group.
Modems and keyboards are input/output devices.
Object classes may have several attributes.
Car has accelerator, break and wheels as parts
Windows is composed of lot of frames.
An account is either type savings or type current.
A country has a capital city.
A file is an ordinary file or a directory file.
A polygon is composed of an ordered set of points.
A route connects two cities.
A student takes a course from a professor.
2(a) Prepare a class diagram for group of classes. (5)
Sink, freezer, refrigerator, table, light, switch, window, smoke alarm, burglar alarm, cabinet, bread, cheese,
ice, door, and kitchen
2(b) Prepare a class diagram for the dining philosopher problem. (6)
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.
2(c). What do you mean by Class Diagram? (1)
3. Read the case study carefully and draw the Use-Case Diagram and class Diagram? (6+6)
Majority of Process Impact employees presently spend an average of 60 minutes per day going to the cafeteria to
Select, purchase, and eat lunch. About 20 minutes of this time is spent walking to and from the cafeteria, selecting their
meals, and paying for their meals by cash or credit card. When Employees go out for Lunch, they spend average of 90
minutes off-site. Some employees phone the cafeteria in advance to order a meal to be ready for them to pick up.
Employees don’t always get the selections they want because the cafeteria runs out of certain items. The cafeteria
wastes a significant quantity of food that is not purchased and must be thrown away. These same issues apply to
breakfast and supper, although far fewer employees use the cafeteria for those meals than for lunch.
Many employees have requested a system that would permit a cafeteria user to order meals on-line, to be delivered to a
designated company location at a specific time and date. Such a system would save those employees who use the
service considerable time and it would increase the chance of them getting the food items they prefer. This would
improve both their quality of work life and their productivity. Knowing what food items customers want in advance
would reduce wastage in the cafeteria and would improve the efficiency of cafeteria staff. The future ability for
employees to order meals for delivery from local restaurants would make a wider range of choices available to
employees and provide the possibility of cost savings through volume purchase agreements with the restaurants. It
might also permit Process Impact to have the cafeteria handle only individual lunches, relying on restaurants. It might
also permit Process Impact to have the cafeteria handle only individual lunches, relying on restaurants to fill orders for
breakfasts, dinners, special events, and weekend meals.
4(a). Consider the following Sequence Diagram and draw its equivalent Collaboration/Communication
Diagram. (6)
4(b). Draw a class diagram for the description below. Make sure to show attributes, multiplicities and
associations, where appropriate. No need to show any operations. (6)
Consider the Mirha Companies-
Usually workers are hired by Mirha Group of Companies (who can only work for one company), and there can be one
or more departments in Mirha Group of Companies. There is a single chief in each company, who is a worker. There
are workers in Department as members and they work in those departments and run one or more projects. Workers
can be a part of 1 to 3 projects, while a project can have 2 to 50 allocated workers. The assumptions can be made that
company have a name and address, while workers have id # , name and a salary.
5(a) What are GRASP Patterns? Explain any two GRASP patterns (4)
5(b) how does high cohesion support low coupling (2)
5(c). List out the steps of preparing domain class model. What are the criteria for identifying right
classes? Apply the steps and find out domain classes for the following Student academic record
management system of GCU Lahore. (6)
The record of GCU's students and the record of the colleges that are affiliated with GCU Lahore are
maintained by a very efficient management system named "Student Academic Record Management System".
Through this system Well-defined curriculum is maintained for all the divisions from which predefined list of
subjects are offered to students in each semester. The students are allowed for exam for all the regular
subjects offered in a particular semester. GCU prepares result based on the grades of all the subjects (external
and internal component) in which student appeared for exam. Any student having greater than four backlogs
in a year is detained and cannot appear for regular subjects in next one year.
6. Problem Statement 12
An expert system has to be developed for prescribing medicine for given symptom. The system should
contain the following features.
1 The user has to query the system by giving his name, age, gender, and symptoms, period for which the user
is having the symptoms. And based on the input the system has to take a comparison with the system given in
the database and prescribe the medicine for the given symptoms.
2 Only the registered user can access the system and so there should be a registration from and after
registration the user has to be given with the password and the user name only if the user data's are valid.
3. In the query form, age group should be a combo box, a list of symptoms in the form of list box
With an option box for selecting many symptoms. While prescribing the medicine for the symptoms the
corresponding diseases, medicine name, and medicine MFT name, along with the price to be displayed.
Consider the following problem statement and
a) Draw the Class diagram and Use Case Diagram of above mentioned Scenario?
b) Is it possible to construct a sequence diagram from the class diagram? Justify your answer.