Sei sulla pagina 1di 4

ASSESSMENT EXAM SAMPLE QUESTIONSCIS 1033 - FUNDAMENTALS OF PROGRAMMING

SAMPLE QUESTIONS - ASSESSMENT EXAM

1. Which of the following most accurately describes in the correct order,


the following stages of the program development process?

a) design, analysis, implementation, testing


b) analysis, design, testing, implementation
c) design, implementation, testing, analysis
d) analysis, design, implementation, testing

2. The value of 7 - 5 + 4 * 3 is

a) 18
b) 4
c) 14
d) none of these

3. Which type of memory is volatile, i.e., it maintains data on a temporary


basis?

a) RAM
b) ROM
c) CD
d) floppy drive
e) hard drive

4. Which component of a computer carries out arithmetic operations?

a) CPU
b) Memory
c) ALU
d) Hard Disk

5. A selection control structure:

a) repeats a number of programs steps multiple times


b) chooses one of several alternatives sets of instructions to be
executed
c) executed a series of instructions in order
d) selects the appropriate I/O device for output

6. A variable which is accessible throughout the whole program is a:

a) global variable
b) local variable
c) constant variable
d) non local variable
7. How many times will the following looping structure be executed?

count = 1;
do {
count++;
cin num;
}
while (count < 10);

a) 20 times
b) 10 times
c) 9 times
d) none of the above

8. Which of the following is not a logical operator?

a) and
b) or
c) not
d) if

9. The following coding could used to load data into a _____________


for (int i=0; i < 5; ++i)
cin f[i]

a) one element array called f


b) one element array called i
c) five element array called i
d) five element array called f

10. The expression P || Q, is true, if:

a) P is true and Q is false


b) Q is true and P is false
c) P is true and Q is true
d) All of the above

11. When parameters are passed between the calling code and the called
function,formal and actual parameters are matched by:

a) their data types


b) their relative position in the formal and actual parameter lists
c) their names
d) whether they are inputs to or output from the function

12. Which of the following is not true of constructor?

a) A constructor has the same name as the class


b) Initialization of an object may done in a constructor
c) A constructor may be called from anywhere in the program
d) The constructor is executed automatically when a object is declared.
13. An array is a(n):

a) class
b) Simple data type
c) Data structure containing multiple values
d) Iterative structure

14. Given the array definition:


float prices[20];
the index range for prices will be:

a) 0 to 20
b) 1 to 20
c) 1 to 19
d) 0 to 19

15. What does the following C++ statement do?

if (A B)
if (B C)
cout << 1 << endl;
else
cout << 2 << endl;

a) Displays only when A B


b) Displays only when A B and A C
c) Displays 2 if C = A regardless of the values of A and B
d) None of the above

16. To model employee data consisting of SSN, name, address, department,


hours worked,and payrate, we should use:

a) strings
b) an array
c) a class
d) float variables

17. Which of the following statements is not true concerning an array?

a) The array elements may be of any type


b) An array elements can be treated like a variable of its element data type
c) An array elements can be passed as a variable to a function
d) It is an unstructured data type

18. A class may contain:

a) properties
b) behavior
c) initialization constructors
d) destructors
e) all of the above
19. Which type of loop is the following (assume variables are type float):

cin score;
while (score != -1)
{ sum += score;
cin score;
}

a) Sentinel controlled
b) Flag controlled
c) Count controlled
d) Even controlled
e) None of the above

20. A function can return at most:

a) 0 values
b) 1 value
c) 2 values
d) any number of values

Answers:

1. d 2. c 3. a 4. c 5. b 6. a
7. c 8. d 9. d 10. d 11. b 12. c
13. c 14. d 15. a 16. c 17. d 18. e
19. a 20. b

Potrebbero piacerti anche