UNIVERSITY OF SWAZILAND
FACULTY OF SCIENCE & ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
PROG~GTEC~QUEsrr
COURSE CODE - EE272
MAIN EXAMINATION
MAY 2013
DURATION OF THE EXAMINATION - 3 HOURS
INSTRUCTIONS TO CANDIDATES
(a/There are FIVE questions in this paper. Answer questions 1 & 2, and any other
TWO questions.
. (b) Each question carries equal marks.
(c) Show all your steps clearly in any calculations.
(d) State clearly any assumptions made.
(e) Start each new question on a fresh page.
, Question 1
(a) What is the difference between an object and a class? [5]
(b) Using an example, explain what is a access specifier? [4]
(c) What are constructors used for and how are they defined? [4]
• (d) The definition of classes should promote encapsulation. Explain. [2]
(e) Explain the difference between an actual parameter and a formal parameter? [3]
(f) How are overloaded methods distinguished from each other? [3]
(g) What is the difference between a static class member and an instance class
member? [2]
(h) Using an example, explain the difference between an object pointer and an object
reference. [2]
Question 2
(a) How does inheritance promote software reuse? [1]
(b) Why would a derived class override one or more of the methods in its base class?
[1]
(c) What is the role of an abstract class? [2]
(d) What is polymorphism? [3]
(e) How does inheritance support polymorphism? [3]
(f) How is overriding related to polymorphism? [4]
(g) Discuss how polymorphism makes software systems extensible and
maintainable? [5]
(h) In what ways might a thrown exception be handled? [3]
(i) What is object persistence and how is it accomplished in C++? [3]
2
FACULTY OF SCIENCE & ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING
PROG~GTEC~QUEsrr
COURSE CODE - EE272
MAIN EXAMINATION
MAY 2013
DURATION OF THE EXAMINATION - 3 HOURS
INSTRUCTIONS TO CANDIDATES
(a/There are FIVE questions in this paper. Answer questions 1 & 2, and any other
TWO questions.
. (b) Each question carries equal marks.
(c) Show all your steps clearly in any calculations.
(d) State clearly any assumptions made.
(e) Start each new question on a fresh page.
, Question 1
(a) What is the difference between an object and a class? [5]
(b) Using an example, explain what is a access specifier? [4]
(c) What are constructors used for and how are they defined? [4]
• (d) The definition of classes should promote encapsulation. Explain. [2]
(e) Explain the difference between an actual parameter and a formal parameter? [3]
(f) How are overloaded methods distinguished from each other? [3]
(g) What is the difference between a static class member and an instance class
member? [2]
(h) Using an example, explain the difference between an object pointer and an object
reference. [2]
Question 2
(a) How does inheritance promote software reuse? [1]
(b) Why would a derived class override one or more of the methods in its base class?
[1]
(c) What is the role of an abstract class? [2]
(d) What is polymorphism? [3]
(e) How does inheritance support polymorphism? [3]
(f) How is overriding related to polymorphism? [4]
(g) Discuss how polymorphism makes software systems extensible and
maintainable? [5]
(h) In what ways might a thrown exception be handled? [3]
(i) What is object persistence and how is it accomplished in C++? [3]
2