Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

W1-2-60-1-6

JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY

UNIVERSITY EXAMINATIONS 2016/2017


THIRD YEAR FIRST SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR
OF BUSINESS INFORMATION TECHNOLOGY

SECOND STAGE FIRST SEMESTER EXAMINATION FOR THE DEGREE OF


BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

HBT 2305: OBJECT ORIENTED ANALYSIS AND DESIGN

DATE: JULY, 2017 TIME: 2 HOURS

INSTRUCTIONS: ANSWER QUESTION ONE (COMPULSORY) AND ANY


OTHER TWO QUESTIONS

QUESTION ONE

a. Name the UML diagrams used for the following:-

i. Modeling requirements. (1 mark)

ii. Modeling work flows. (1 mark)

iii. Modeling behavior of an object. (1 mark)

iv. Interaction between groups of objects. (1 mark)

b. i. Explain the difference between object and structured approach to


system analysis and design. (4 marks)

ii. State any four advantages of OOAD over traditional approach.


(4 marks)

iii. Explain why modeling is important in system analysis. (2 marks)

c. Distinguish between class notation and object notation in UML. (4 marks)

d. List any explain the two types of functional requirements identified by use
case analysis. (6 marks)

1
e. Explain the following OOAD concepts:-

i. Abstraction. (2 marks)

ii. Encapsulation. (2 marks)

iii. Polymorphism. (2 marks)

QUESTION TWO

a. List and explain the different relationships between classes in UML


modeling. (6 marks)

b. Identify and show the relationship between classes in the following


statement.

“An airline company has employees. A team builds an airplane which has a
number of components. An airplane lands and takes off from an airstrip in
an airport. The airplane carries passengers from a source to destination. An
airplane is managed by a captain and co-pilot alone with his cabin crew
consisting of airhostess and attendants. (10 marks)

c. Draw a state diagram to depict the states of the CPU. (4 marks)

QUESTION THREE

Seats can be reserved by customers on the web sit of the bus company. The
customer has the option to directly pay for the seat through the web sit. In that
case, the seat can not be cancelled (neither by the customer nor by the bus
company). If the customer has not paid for the seat, the bus company can cancel
the seat if the customer does not show up one hour before the trip. When the
reservation is cancelled, the seat will be came free and can be sold to another
customer. Both the customer and the company staff must authenticate themselves
for performing operations with the system.

a. Draw a use case diagram for describing the functional requirements of the
above system. (10 marks)

b. List and justify three non-functional requirements that could be important


for the above system. (6 marks)

2
c. Explain the following relationships among use cases. (4 marks)

i. Extend

ii. Include

QUESTION FOUR

To give an exam, an instructor first notifies the students of the exam date and the
content to be covered. He then prepares the exam paper with sample solutions,
get it copied to produce enough copies for the class, and hands it out to students
on the designated time and location. The students write their answers to exam
questions and hand in their papers to the instructor. The instructor then gives the
exam papers to the TAS, along with sample solutions to each questions, and gets
them to mark it. He then records and returns the papers to the students.

Required:-

a. Define generalization and aggregation as used in UML modeling.


(4 marks)

b. Use UML notations to express the following aggregation “ some people


keep animals as pets” (4 marks)

c. Justify the statement “A method implements the behavior of an object”.


(2 marks)

d. UML models are used in both analysis and design phases of software
development. What is the aim of each of the two phases. (4 marks)

e. Explain the use of a deployment diagram in UML modeling. (2 marks)

f. Draw a deployment diagram that depicts a web based app that will be used
by patient to book, pay and cancel doctor’s appointments. (4 marks)

Question One:
a. UML diagrams used for: i. Modeling requirements: Use Case Diagrams ii.
Modeling work flows: Activity Diagrams iii. Modeling
behavior of an object: State Diagrams iv. Interaction
between groups of objects: Sequence Diagrams
b. i. Difference between object and structured approach:

3
 Object-Oriented Approach (OOAD): Focuses on modeling real-world
entities as objects and their interactions. It promotes encapsulation,
inheritance, and polymorphism.
 Structured Approach: Focuses on decomposing a system into smaller
functional modules or components and emphasizes procedural design.
ii. Advantages of OOAD over traditional approach:
1. Reusability: Objects and classes can be reused across different projects.
2. Modularity: Encapsulation leads to well-defined and modular components.
3. Flexibility: Inheritance and polymorphism allow for more adaptable and
extensible designs.
4. Modeling Real-world: OOAD closely resembles real-world entities and
their relationships.
iii. Importance of modeling in system analysis: Modeling helps in:
 Understanding the system's requirements and behavior.
 Visualizing complex structures and processes.
 Communicating effectively with stakeholders.
 Identifying potential issues early in the design phase.
c. Distinguishing class notation and object notation in UML:
 Class Notation: Represents the structure and attributes of a class using a
rectangular box divided into three compartments (name, attributes,
methods).
 Object Notation: Represents an instance of a class in a diagram. It is
shown as the name of the object followed by a colon and the class name.
d. Functional requirements identified by use case analysis:
1. Primary (Main) Functional Requirements: These are essential functions
that the system must perform to achieve its main goals.
2. Secondary (Supporting) Functional Requirements: These are additional
functions that enhance the system's usability, performance, or user
experience.
e. Explain OOAD concepts: i. Abstraction: Focuses on the essential aspects of
an object while ignoring irrelevant details. It simplifies
complex reality by modeling classes and their
interactions. ii. Encapsulation: Bundles data (attributes)
and the methods (functions) that operate on the data into
a single unit (class), ensuring data integrity and hiding
implementation details. iii. Polymorphism: Allows
objects of different classes to be treated as objects of a
common superclass through inheritance. Enables
methods to be overridden in subclasses, providing
flexibility in behavior.
Question Two:
a. Different relationships between classes in UML modeling:
1. Association: A generic relationship representing a connection between
classes.
2. Aggregation: A "whole-part" relationship, where one class (whole)
contains or is composed of other classes (parts).

4
3. Composition: A stronger form of aggregation where the lifecycle of parts
is controlled by the whole.
4. Inheritance (Generalization): Represents an "is-a" relationship, where one
class inherits attributes and behaviors from another.
5. Dependency: A relationship where changes in one class can affect another
class.
b. Relationships between classes in the given statement:
 Airline Company has Employees (Association)
 Team builds Airplane (Association)
 Airplane consists of Components (Aggregation)
 Airplane uses Airstrip (Dependency)
 Airplane is managed by Captain and Co-Pilot (Association)
 Airplane's Cabin Crew consists of Airhostess and Attendants (Aggregation)
 Airplane lands and takes off from Airstrip (Association)
 Airplane carries Passengers (Association)
c. State diagram for CPU states:
[Diagram depicting CPU states]
Question Three:
a. Use case diagram for reservation system:
[Diagram depicting use case relationships]
b. Non-functional requirements:
1. Security: Ensuring the authentication and authorization of both customers
and company staff for system operations.
2. Performance: The system should handle high traffic and process payments
efficiently.
3. Reliability: The system should have a high uptime and should be able to
handle seat cancellations and reassignments without errors.
c. Relationships among use cases: i. Extend: Allows optional behavior to be
added to a use case. The extended use case is optional
and depends on certain conditions. ii. Include:
Encapsulates common behavior that is shared by
multiple use cases. The included use case is essential
and is always invoked by the base use case.
Question Four:
a. Generalization and Aggregation in UML:
 Generalization: Represents an "is-a" relationship between a superclass and
one or more subclasses. It implies inheritance and code reuse.
 Aggregation: Represents a whole-part relationship, where a class (whole)
contains or is composed of other classes (parts). It signifies a weaker
relationship than composition.
b. Aggregation notation:
[Diagram depicting aggregation relationship]
c. "A method implements the behavior of an object" justification: A method
in an object's class defines the actions that the object can
perform. By invoking methods, the object expresses its
behavior and interacts with other objects and the system.
Methods encapsulate the logic that allows the object to
5
respond to messages and perform tasks, thus
representing the behavior of the object.
d. Aim of analysis and design phases in software development:
 Analysis Phase: Aims to understand and define the problem domain, gather
requirements, and create a conceptual model of the system.
 Design Phase: Aims to create detailed technical specifications, define
system architecture, and plan the implementation approach.
e. Use of deployment diagram in UML modeling: A deployment diagram
visualizes how software components are deployed onto
hardware nodes (e.g., servers, machines). It shows the
physical distribution of components across different
nodes, helping to understand the system's deployment
topology.
f. Deployment diagram for web-based app:
[Diagram depicting deployment of web-based app]
Remember that my response may not contain exact diagrams due to the text-based
format, but I've tried to describe the concepts as
accurately as possible.

You might also like