ALGORITHMS AND PROGRAMMING LANGUAGES (CENP2202)
Electrical and Electronic Engineering - EEE
Semester: Second Semester
Level: 200
Year: 2019
REPUBLIC OF CAMEROON THE UNIVERSITY OF BAMENDA
Peace-Work-Fatherland P.O Box 39 Bambili
First Semester Examination
School: COLTECH Department: Electrical and Power Engineering Option: ALL
Course Code: Course Title: C++ Programming Credit Value: Level 300
Lecturer: Mbiethieu Cezar Credit Value
Date: Time: 1h:30 Start Time: End Time:
Exercise 1:
(12marks)
Explain the following concepts in OOP: class, object, constructor, inheritance
Exercise 2: (15marks)
Write a C++ function which calculates the factorial of a given positive number (Ensure that
the number entered is positive)
0! = 1; 1 != 1; 2!=2*1; 3= 3*2*1; 4=4*3*2*1
Exercise 3:
(13marks)
Write a C++ program that reads N numbers and counts the number of positive numbers
then print the average of all positive values.
Exercise 4: (30marks)
Given the following Object Oriented code written in C++,
www.schoolfaqs.net