COMSATS University Islamabad, Wah Campus: Instructions
COMSATS University Islamabad, Wah Campus: Instructions
Instructions:
Attempt all questions.
BE PRECISE AND DON’T COPY.
Attempt the paper in sequence as given in question paper. Make sure to write actual
question number on the answer sheet.
Each question must be attempted on A4 sheet (HAND-WRITTEN) with following personal
information on the top of each sheet:
STUDENT NAME, REGISTRATION NUMBER, CNIC NUMBER,
CONTINUATION SHEET NUMBER (E.G., 1/4, 2/4 …), SIGNATURE.
Submit one pdf file on CUOnline on time. Late submissions will not be accepted. So take
care of time.
Short Questions
20 marks (Be Precise)
[CLOs – 1, 2, 3]
2. What control flow mechanism you would opt for real-time Canteen Automation System?
Because multiple choices are possible in most cases, justify your choices. [3]
3. For each of the following sets of classes, find an appropriate superclass and the
polymorphic operations that should be included in this superclass. Explain the way these
operations would behave in each subclass and identify some operations that might be
present in only one of the subclasses. [3]
(a) Square, Circle, Rectangle
(b) Truck, Ambulance, Bus
(c) Technician, Administrative Assistant, Manager
4. What are some ideas/problems that you can implement using a solution provided by
Adapter Pattern? [3]
5. The following requirements are stated in an unverifiable way. For each, indicate the kind
of requirement it is, and rewrite it so that it is verifiable (make up some suitable details).
[4]
(a) A modern programming language must be used.
(b) A development process will be used that will ensure the system is of high quality.
(c) The http server will have high availability and throughput.
(d) The system must be produced at minimum cost.
(e) The automatic teller machine should be fast.
6. For each of the following systems, discuss under what circumstances it would be worth
making it into a client–server system, as opposed to just creating a single program that does
everything. In the case of a client–server system, indicate what work could be done by the
server, and what by the client. In answering this question, make your best judgment, using
whatever knowledge you already have about software applications. [4]
(a) A word processor.
(b) A system for doctors to look up patient records when visiting a patient.
(c) A home alarm system that monitors various sensors such as motion detectors, smoke
detectors and window-opening sensors.
One of your project partners has been working on a design for the CUOnline system. He has
emailed you the following questions:
a) Should a Student object store a list of the student's courses, or should a Course object
store a list of the course's students? Or both, or neither?
b) Right now our RegistrationSystem class holds all courses and students, contains all
logic for checking prerequisites, and has the methods for adding and dropping a course. It
also has the database connection logic right now. Is this okay?
c) Since there are different levels of students, we made an inheritance hierarchy. The
superclass is called Student, and the subclasses are called Freshman, Sophomore,
Junior, and Senior. We were going to add another subclass called GradStudent; is
this the right design?
d) Right now the Student class has a display method that prints out the HTML for the
student to be displayed on the web site. We also have a similar display method in the
Course class. Is this okay, and should we add a display method to other classes?
e) Right now, the Student object talks to the Registrar object when it wants to send
messages to a Course object. The Registrar object intercepts the messages and passes
them along to the relevant Course. The Course also sends messages to the Registrar
object when it wants to access a particular Student. What changes, if any, would you
suggest to this design?
How would you answer these questions? Support your decisions by citing relevant design
concepts and heuristics presented in the course.
Question # 02 [5]
Below is the UML class diagram for a University Management system. You should modify
and/or redraw the class diagram and make the following improvements:
(a) Correct any improper uses of UML syntax. [1]
(b) Improve the object-oriented design, in terms of what classes are chosen or what
state/behavior is provided in each, to better follow the object-oriented design heuristics and
patterns that were taught in class. [1]
(c) Add another class to the diagram representing a Course. Into this class, place any
state and behavior that you feel is relevant for courses. Connect the Course class to the
other class (es) in the diagram as appropriate to indicate the relationship between the
classes.
Your diagram should show all relevant classes, methods, fields, access modifiers,
qualifiers and relationships between classes/objects with appropriate adornments in
proper UML syntax. Follow appropriate object-oriented design guidelines as discussed in
class, including design patterns as appropriate. Make sure that your design accurately
represents the major elements in the spec. You may add UML comments to your diagram
if necessary for clarification. You will be graded both on proper UML syntax and also on
the quality of your design. [1]
(d) You need to covert final model into Java code. [2]
Question # 03: [15]
Pick a real-time system and perform Analysis Activities on it. And then based on the principles
of decomposition find out the Architectural Style that is best suited for the situation.
Good Luck!!!