0% found this document useful (0 votes)
4 views3 pages

Object-Oriented Analysis Exam 2019

Uploaded by

Abdullah Hassan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Object-Oriented Analysis Exam 2019

Uploaded by

Abdullah Hassan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNIVERSITY EXAMINATIONS: 2018/2019

EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIENCE IN


INFORMATION TECHNOLOGY

BIT2107 OBJECT ORIENTED ANALYSIS & DESIGN


APRIL 2019 TIME: 2 HOURS

Instructions
o Answer question ONE and any other TWO.
o Question One carry 30 marks, others 20 marks each.

QUESTION ONE. (COMPULSORY)

(a) Give the meaning of the following terms in relations to Object Oriented field:
(12 Marks)
i. Object
ii. Class
iii. Association
iv. Aggregation
v. Encapsulation
vi. Inheritance

(b) Highlight any three limitations of the structured approach to software development.
(3 Marks)

(c) Define Unified Modeling Language (UML) in object orientation and describe
its main building blocks. (4 Marks)
(d) Define sequence diagram and show symbols used to draw them. (4 Marks)
(e) Describe the three views used in UML and show all 7 diagrams (7 Marks)
QUESTION TWO

(a) Consider the following scenario.

"Nurses work on a particular ward. Doctors are assigned a number of patients and
during their rounds visit a number of different wards. If a doctor needs advice he/she
may consult with a specialist consultant regarding a particular patient. The specialist
may see the patient. Specialists are basically senior doctors."

Draw the class diagram to include any inheritance, aggregation or composition and
multiplicities where possible. (12 Marks)

(b) A student in KCA University intends to go for a class. Draw his possible activity diagram.
Remember to include swim lanes, forks, and joins among others. (8 Marks)

QUESTION THREE

(a) In my local food kiosk, you find the following items: Maize, bananas, beans and Oranges.
Draw a hierarchical class diagram to illustrate the kiosk. (4 Marks)

(b) Study the scenario below and answer the questions that follow:

When a student arrives at KCA University, Admission clerk register them at their desk. The
registration is done by a way of entering the student details in the registry. Since admission
clerk is interested in the student, academic level in the university among other details they
records includes names, academic level, town, age and contacts. After registration, the student
is handed over to the faculty. The faculty staff then helps the student to become a faculty
member where they learn until the graduate.

(i) Identify possible actors (3 Marks)


(ii) Identify the possible use cases (3 Marks)
(iii) Draw a use case diagram showing clearly how actors interact with the use cases as
you have stated in (i) and (ii) above. (7m Marks)
(iv) What is the significant of use cases in the Object oriented analysis and design
(3 Marks)
QUESTION FOUR

(a) (i) What is a state diagram? (2 Marks)


(ii) Create a state diagram for this scenario. (10 Marks)

The washing machine has 2 major states : pause and runnable. A washing machine in the
runnable state cycles around the following substates - stopped, filling, washing and spinning.
The machine can only start running if the door is closed and the machine will pause
immediately the door is opened. The washing machine runs to a program. The machine
will restart the program each time it re-enters the runnable state

(b) What do you understand by the following terms as used in Object oriented concepts?
(i) Prototyping (2 Marks)
(ii) Spiral Model (2 Marks)
(iii) Inception (2 Marks)
(iv) Transition (2 Marks)

QUESTION FIVE

(a) Discuss the following visibility types with the use of an appropriate symbol: (6 Marks)
(i) Private
(ii) Public
(iii) Protected
(b) (i) What do you understand with the term multiplicity? (2 Marks)
(ii) Outline any four types of multiplicities (4 Marks)
(c) Explain any two common uses of interaction diagrams (4 Marks)
(d) Discuss any two situations where activity diagrams are suitable. (4 Marks)

Common questions

Powered by AI

Inheritance and polymorphism are core principles of object-oriented programming that enhance code reuse and flexibility. Inheritance allows the creation of a new class based on an existing class, facilitating the reuse of existing code without modification. Polymorphism enables objects to be treated as instances of their parent class, allowing for dynamic method binding and enhancing runtime flexibility. These features support extending existing code with minimal changes, increasing software adaptability in response to new requirements .

Unified Modeling Language (UML) is a standardized modeling language used to specify, visualize, develop, and document the artifacts of software systems. Its main components include structure diagrams (such as class diagrams, object diagrams), behavior diagrams (such as use case diagrams, sequence diagrams), and interaction diagrams (such as timing diagrams, communication diagrams). UML serves as a blueprint for both the system’s structure and behavior, aiding in visualizing the system architecture clearly and concisely .

Multiplicity in UML diagrams defines the number of instances of one class that can be associated with a single instance of another class in a relationship. It specifies if the relationship is one-to-one, one-to-many, many-to-one, or many-to-many, significantly influencing how these interactions are modeled. For example, a one-to-many relationship allows for different design decisions regarding memory allocation, resource sharing, and instance management, influencing both the architectural constraints and the potential complexity of the software system .

Encapsulation enhances object-oriented programming by bundling data with the methods that operate on that data, thereby restricting direct access to some of an object's components. This protection of data helps to reduce system complexity and increase robustness by hiding the internal representation of an object and only exposing a well-defined interface to the outside world. It supports modularity and prevents unintended interference and unauthorized access, leading to more reliable code .

Use case diagrams are important in software design as they provide a high-level view of the system’s functional requirements. They help identify the interactions between users and the system, clarifying what system functions are performed for which user. This visualization aids in ensuring that all relevant user scenarios are considered, improving the system design's completeness and effectiveness. Additionally, they communicate the system’s functionalities to non-technical stakeholders clearly .

The structured approach to software development has several limitations compared to the object-oriented approach. It often leads to code that is less reusable due to the top-down procedural style that can complicate maintenance and scaling. It also tends to be less flexible in handling changes in requirements because of its rigid, linear nature. Moreover, structured programming can struggle with modeling real-world problems as it does not offer the abstraction and encapsulation benefits that object-oriented paradigms do .

Prototyping is particularly beneficial in scenarios where user requirements are not well-understood or are complex, thus requiring clarification. It allows for early detection of design errors and mismatches with user expectations by providing a tangible model to users. Prototyping can also enhance stakeholder communication, facilitate user feedback, and support iterative refinement of requirements, ensuring that the final product better aligns with user needs .

Class diagrams represent relationships in UML using various connectors. Inheritance is depicted with a solid line and a closed, unfilled arrow pointing to the parent class, indicating a 'is-a' relationship. Aggregation is represented by a line with a hollow diamond pointing to the part that describes a whole-part relationship where the part can exist independently. Composition is shown by a filled diamond indicating a whole-part relationship where the part's lifecycle is managed by the whole, suggesting a stronger dependency .

Interaction diagrams are a subset of UML diagrams that describe how objects interact in terms of a sequence of messages. They include sequence diagrams, communication diagrams, and timing diagrams. Common uses of these diagrams include modeling dynamic aspects of the system, specifying detailed protocols of object interactions, and illustrating how different parts of a software system collaborate. This helps in understanding the temporal ordering of interactions and in analyzing real-time operations .

Sequence diagrams play a critical role in modeling the temporal sequence of messages exchanged between objects to achieve a particular functionality in a software process. They are typically constructed using elements such as actors, objects, messages/arrows representing communication, and lifelines denoting object's lifetime in the interaction. Sequence diagrams enhance understanding of interaction order and enable validation of the architectural model by visualizing the flow of control and data .

You might also like