You are on page 1of 6

NATIONAL UNIVERSITY OF SCIENCE AND TECHNOLOGY

School of Electrical Engineering and Computer Science

Object Oriented Analysis and Design (CS-812)


ASSIGNMENT # 1

UML Diagrams
[Class, object, Sequence and State]

SUBMITTED TO: Dr. Rafia Mumtaz


SUBMITTED BY: Abdul Basit
CLASS: MS - IT
DATE OF SUBMISSION: 09-November-2020
Question 1
Consider the following simplified description of a university where professors teach seminars in
which students can enroll. A professor has a name, address, phone number, email address, and
salary. A student has also a name, etc., but no salary. A student, however, has an average mark
(of the final marks of his or her seminars). A seminar has a name and a number. When a student
is enrolled in a seminar, the marks for this enrolment are recorded and the current average as
well as the final mark (if there is one) can be obtained from the enrolment. From a student one
can obtain a list of seminars he or she is enrolled in. Professors teach seminars. Each seminar has
at least one and at most three teachers. There are two types of seminar: bachelor and master.
From a bachelor seminar, student cannot withdraw. From a master seminar they can. Construct
a class diagram for this university. Add attributes and methods where necessary.
Answer
Question 2
Draw a class diagram that could generate the object diagram shown in Figure below. Make
reasonable choices for multiplicity

Answer
Question 3
A client wishes to open a new account at a bank branch. To do so, his instance of class Client must
first be retrieved from the central bank server. For a new client, an instance of Client must be
created. An instance of BankAccount is then created using the Client object. A deposit must then
immediately follow, to complete the account creation process.
Answer
Question 4
You are required to model the requirements of a cruise control system of an automobile. The
cruise control system is controlled by a master button. Initially, it is turned on by the master
switch. The master switch can be turned off at any time. When it is turned on, the system is in
the stand-by mode, the driver of the automobile can press Button + to engage the cruise control
at the current speed by accelerating the pedal of the automobile. When the cruise control is
engaged, if the driver presses the brake, the system will be disengaged and return to stand-by
mode. When the cruise control is engaged, the driver can press Button plus (+) twice to increase
speed by one mile per hour or Button minus (-) to decrease speed by one mile per hour. When
in the stand-by mode the drive switches off the mater switch it returns to off mode.
Construct a state chart or state diagram. Make sure to give the minimum number of states
necessary. Identify the start state and the final state(s).
Answer
Question 5
Enhance the Figure below to handle the following situations:
(a) The course section can be cancelled when in any state, except after it has been taught.
(b) A student can drop out at any time, except after the course section has been taught.

Answer

You might also like