Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
83 views

CSC 221 Object Oriented Analysis, Design and Programming

This document contains instructions for a second year examination in computer science at the University of Embu for the 2020/2021 academic year. The exam is for the course CSC 221: Object Oriented Analysis, Design and Programming and will take place on May 5, 2021 from 11:00AM to 1:00PM. Students must answer one compulsory question and any two other questions from a choice of four. The questions assess knowledge of object-oriented concepts like inheritance, polymorphism, and encapsulation as well as design techniques like use case modeling and class diagrams. Students are asked to write C++ programs demonstrating class creation and the use of constructors.

Uploaded by

Watiri Steve
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

CSC 221 Object Oriented Analysis, Design and Programming

This document contains instructions for a second year examination in computer science at the University of Embu for the 2020/2021 academic year. The exam is for the course CSC 221: Object Oriented Analysis, Design and Programming and will take place on May 5, 2021 from 11:00AM to 1:00PM. Students must answer one compulsory question and any two other questions from a choice of four. The questions assess knowledge of object-oriented concepts like inheritance, polymorphism, and encapsulation as well as design techniques like use case modeling and class diagrams. Students are asked to write C++ programs demonstrating class creation and the use of constructors.

Uploaded by

Watiri Steve
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIVERSITY OF EMBU

2020/ 2021 ACADEMIC YEAR

SECOND SEMESTER EXAMINATIONS

SECOND YEAR EXAMINATION FOR THE DEGREE OF BACHELOR OF SCIF,NCE


IN COMPUTER SCIENCE

CSC 221: OBJECT ORIENTED ANALYSIS, DESIGN AND PROGRAMMING


DATE: MAY s, 2021 TIME: 11:OOAM-l:OOPM

INSTRUCTIONS:

Answer Question ONE and ANY other TWO Questions

QUESTION ONE (30 MARKS)


a) Define the following: (5 marks)
i) Multiple Inheritance
ii) Object oriented analysis
iii) Association
iv) Polymorphism
v) Encapsulation
b) Briefly discuss the importance of Object Orientation Paradigm. (4 marks)
c) Differentiate state diagram and activity diagram. (4 marks)
d) Describe the basic activities in object oriented analysis and explain how use case modeling is
usefulinanalysis. (4marks)
e) State three ways in which learning institution would cope with the emerging trends in OOP.
(3 marks)
f) Davido would like to apply inheritance in a project he is undertaking using OOP for a client.
With and aid of illustration in each case explain three forms of inheritance he would use.

A;?
' ? 15027001 :2013 Certified Knowledge Transforms
d
laGFl!.
150 9001:2015 Certified
'd?

Page ] of 4
(6 marks)

g) Study the following C++ program segment and answer the questions that follow.
cl.ass poirit- {
prxvaCe :
lxi w .Xy ?Y /

p';:>xn?F-? ('.la .r1.?'laa= .i-' z .in't" 3' .) {x??i ; '5???':j y ?> ('
palyli c 1
float: midx() ;
',7 <.'> la . c'.i '-jl 2-?a'. S 1=. .1'. ia-i. 'za' .x y ( ) r'
};

i) Identify two errors in the program providing a possible solution in each case.
(2 marks)

Explain the implication of using each of the access specifiers in the program.
(2 marks)

QUESTION TWO (20 MARKS)


a) Describe the following concepts: (4 marks)

i) OOD
ii) OOP
b) Explain Use case diagram for Bank withdrawal: (8 marks)
The customer inserts the ATM card in an ATM machine and types in the PIN number.
The ATM system checks that the customer's PIN number is correct. Ifit is not, the
system cancels the transaction and rejects the card. If correct, the system presents
the customer with options of the amount to money to with draw and the customer
selects the amount to withdraw. The system then checks that the customer's
account has sufficient amount of money. If it does, the system debits the account
and dispenses the money. Otherwise, the system cancels the transaction.

c) Write a C++ program that will create a class named rectangle with length and breadth as its
member data. The class should also contain a constructor for initializing the dimensions and

z. $?X ?N;?
150 27001:2013 Certified Knovvledge Transforms 150 9001:2015 Certified
a

Page 2 of 4
two member functions for determining the area and perimeter of an object with length and
breadth as 10.5 and 7.O respectively. (8 marks)

QUESTION THREE (20 MARKS)


a) With the aid of well labelled illustrations, discuss any two diagrams of the Use Case
Model. (4 marks)
b) Draw a class diagram model to communicate the following: Jilin Corporation has several
employees. The company keeps track of each employee's lastname, firstname,
middleriame, gender, home address, date hired and birthdate. Some employees are
salaried employees. For those employees, the company is interested in each one's
annual salary. Other employees are hourly employees. For hourly employees, the
company is interested in knowing each one's hourly pay rate. (8 marks)
c) Write a C++ program that uses an array of objects to generate the following output. Use
forloop. (8marks)

QUESTION FOUR (20 MARKS)


a) Distinguish between universal polymorphism and ad-hoc polymorphism as used in OOP.
(4 marks)
b) You are the system administrator of Embu University, explain with the aid of a
use case diagram a system how you would develop an online E-Learning system.
(8 marks)
c) Explain the purpose of Analysis and Design in UML . (4 marks)
d) Explain the function of each of the following types of constructors:
i) Default: (2marks)
ii) Dynamic (2marks)

Ii;@')'sz.
%..
150 27001:2013 Certified Knovvledge Transforms e 150 9001:2015 Certified

Page 3 of 4
QUESTION FIVE (20 MARKS)
a) Define the following terms as used in OOP:
i) super class; (2 marks)
ii) derived class. (2 marks)
iii) Scope resolution operator; (2 marks)

b) Describe the Object-Oriented Software development life cycle (6 marks)

c) Write a C++ program that will implement a class named arithmetic with three integers
initialized to s, 7 and 10 respectively and a member function used to determine and
output the product of the integers. Use a parameterized constructor. (8 marks)

-END-

<?.'

150 27001:2013 Certified Knovvledge Transforms 150 9001:2015 Certified

Page 4 of 4

You might also like