Professional Documents
Culture Documents
Dcs 106 Resit
Dcs 106 Resit
INSTRUCTION: Answer Section A on the SHADING sheet and Section B in the Answer
Booklet provided. YOU ARE REQUIRED TO SUBMIT SECTION A WITH YOUR
ANSWER BOOKLET
1
c. internal d. interface
8. Which of the following is not a
fundamental data type in C++? 15. Which of the following OOP concepts
a. short b. bool enables data hiding?
c. char d. string a. internal functions. b. inheritance.
9. What is the output of the following code c. encapsulation. d.
extract? polymorphism
If(5>10); 16. Given two global arrays int a[5]; and
cout<<”5 not greater”; int b[5]={};, which of the following
2
c. long int, int, short int. cout<<”Full list”<<endl;
21. The expression 5%2.0 will results to c. Full list d. both b and c
c. 2 d. an error programs.
3
multiple word names such “Jonas Smith” for(int b = 0; b < 4; ++b)
cout<<a<<" "<<b<<" ";
as input, the …... function should be used.
cout << endl;
a. string buffer b. getline
a. 16 b. 8 c. 4 d. 0
c. insertion d. cin
40. Standard numeric codes used to represent
35. Unless otherwise specified arguments are
alphabets are called …………. .
passed to functions by ………. .
a. standard codes b. constants
a. address b. value
c. Unicode d. bar codes
c. reference d. b and c only
41. A variable that is known to all functions
36. When an if statement occurs within either
within a file is said to be ………………. .
the if or else clause of another if
a. exposed b. general
statement, it is known as a ………. if .
c. global d. worldly
a. self-contained b. layered
c. nested d. sheltered
42. A translator that notes whether you have
37. What is the output of the following code
used a language correctly might be called
segment?
a ……. .
int x = 7, y = 15;
if(x < 0 || y < 0) a. thesaurus b. compiler
x = 25; c. coder d. decoder
y = 45; 43. A Standard Library file is synonymous to
cout << x << ", " << y << endl;
a Header file.
a. 7, 15 b. 7, 45
a. True b. False
c. 25, 15 d. 25, 45
44. The process of combining two or more
38. The code extract below implements a(n)
stings using the operator + is called?
………… loop.
a. addition b. concatenation
int number = 1;
c. joining d. arithmetic
while(number <= 10){
cout << number << endl; operation
} 45. The process of correcting errors in a
n++; program’s source code is referred to as?
a. recursive b. sequential a. checking b. compiling
c. finite d. infinite c. maintenance d. debugging
39. How many times does the loop body in 46. Comments in a program’s code are
the following code execute? executed at run time?
for(int a = 0; a < 4; ++a)
a. True b. False
4
47. long int, float, and int are all of preprocessor directives?
real numeric data types. a. they begin with #
a. True b. False b. terminates with a semi column
48. All user-defined functions in C++ c. are executed in the main function
programs are executed by calling them in d. a and b only
the ……… 50. Which of the correctly declares and
a. preprocessor directive. initialises a variable of type char?
b. standard library files. a. char=’z’; b. char c=z;
c. main function. c. char c=’z’; d. char
d. std namespace ==’z’;
49. Which of the following is/are attribute(s)
Dr. A Salifu
5
6