UGANDA BUSINESS AND TECHNICAL EXAMINATIONS BOARD
Business and Humanities Certificate Examinations
MAY-JUNE 2024 SERIES
PROGRAMME
NATIONAL CERTIFICATE IN COMPUTER MAINTENANCE AND REPAIR
PAPER NAME
PROGRAMMING FUNDAMENTALS (C++)
PAPER CODE
NCCM221/ NCPF212
YEAR II
2½ HOURS
MONDAY, 13TH MAY, 2024
INSTRUCTIONS TO CANDIDATES
1. This paper consists of two sections A and B.
2. Section A is compulsory and carries 20 marks.
3. Section B consists of six questions. Answer only four questions from this section.
4. All questions carry equal marks.
5. All answers to each question should begin on a fresh page.
6. Do not write on the question paper.
7. All answers and rough work should be done in the official answer booklet provided.
8. Read other instructions on the answer booklet.
© 2024 Uganda Business and Technical Examinations Board Turn Over
SECTION A - (20 MARKS)
Attempt all questions in this section.
Question One
(a) Define the term abstraction as used in C++ programming language. (02 marks)
(b) List four advantages of object oriented programming. (04 marks)
(c) List four reserved words used in C++ programming language. (04 marks)
(d) Differentiate between an assembler and a linker as used in C++ programming.
(04 marks)
(e) Define the term initialization as used in C++ programming. (02 marks)
(f) Explain two conditional statements in C++ programming language. (04 marks)
SECTION B - (80 MARKS)
Answer only four questions from this section.
Question Two
(a) Explain the term programming as used in computing. (02 marks)
(b) Explain four C++ language features that mostly supports different programming
styles in the system development or program execution. (08 marks)
(c) The program below flagged different errors on compilation.
#include<stream>
int main
{
cout << "If this text",
cout >> " appears on your display, ";
cout << " endl;"
cout << 'you can pat yourself on ' << " the back!" <<
endl.
return 0;)
(i) Identify the different errors in the program. (04 marks)
(ii) Rewrite the program correctly. (06 marks)
2
Question Three
(a) Explain debugging as applied to C++ programming language. (04 marks)
(b) Write a program in C++ that accepts input from the user as firstName, surName
and yearOfBirth. It should then display both names and year of birth one after
another sequentially. (08 marks)
(c) Create a C++ program to calculate the square root of a number. Use your program to
determine the square root of 4, 12.25 and 0.0121. (08 marks)
Question Four
(a) Distinguish between an if… statement and if… else statement as used in C++.
(04 marks)
(b) Explain three escape characters that are used in C++ programming language.
(06 marks)
(c) A survey was carried out in Western and Northern Uganda to determine which region
with the tallest people. The peoples’ height was measured and categorized as follows;
people with height between 165cm and 195cm are tall, those who measure between
150cm and 165cm are average and those with below 150cm are dwarfs. Write a
C++ program that accepts the height of a person in centimeters and categorizes the
person according to their height. (10 marks)
Question Five
(a) Define a variable as used in C++ programming language. (02 marks)
(b) Explain four reasons for using C++ programming language. (08 marks)
(c) Write a C++ program that will accept 10 random numbers input by the user, stores
the numbers in an array and then outputs the array. (10 marks)
Question Six
(a) Explain the difference between an operand and an operator. (02 marks)
(b) Write an algorithm and a flow chart illustration of a do {…} while loop in a C++
programming language. (08 marks)
(c) Write a program in C++ that will read 10 numbers input by a user then returns their
sum and average. (10 marks)
3 Turn Over
Question Seven
(a) Differentiate between a declaration and an assignment as used in C++.
(02 marks)
(b) Explain three data types that are used in a C++ program. (06 marks)
(c) Write a program in C++ to count the total number of letters, digits and special
characters in a string of 100 characters maximum. (12 marks)
END