MC - Problem Solving Programming
MC - Problem Solving Programming
Multiple Choice
Identify the choice that best completes the statement or answers the question.
1. The variable CustBalance stores the amount of 5. Which of the following algorithms satisfies the
money owed by customers. CustBalance is MOST requirement of asking the user to input two
likely of data type numbers, calculating the average and displaying the
result?
a. integer
b. character a. display ‘Enter two numbers’
c. real input a, b
d. array c (a+b)/2
display c
2. Which of the following control structures is the
MOST appropriate for reading data from an array? b. input a, b
c (a+b)/2
a. Sequence display c
b. Selection c. display ‘Enter two numbers’
c. Repetition input a, b
d. Recursion c a+b/2
display c
3. Given the following algorithm
d. input a, b
c a + b/2
j5
display c
kj
jj+k 6. Which of the following algorithms does NOT
kj+3 display four consecutive numbers?
display k
a. for v = 2 to 5
The value displayed for k is display v
a. 10 b. h 1
b. 11 while h < 5
c. 13 display h
d. 14 hh+1
end while
4. The following variables s, t and u have been
c. for k = 7 down to 4 step -1
assigned the values shown.
display k
s5
d. f 6
t6
while f < 3
u3
display f
ff-1
Which of the following statements does NOT
evaluate to true? 7. The variables h and s are assigned the following
values, h 4 and s 3 * h.
a. u > 7 and t <= 7 Display h + s * 2 will show
b. s < t or u < s - 2
c. u - 2 >= 1 a. 28
d. t <> 4 or s = 5 b. 30
c. 32
d. 38
a. write
8. Which of the following languages is only b. read
understood by computers? c. writeln
d. readln
a. 4 GLs
b. Machine languages 15. Program implementation involves a number of
c. Natural Languages steps. Which of the following steps is NOT
d. Procedural languages legitimate?
9. Which of the following languages is NOT a high- a. Executing
level language? b. Bonding
c. Compiling
a. C d. Linking
b. COBOL
c. ASSEMBLY 16. Which of the following identifiers is NOT a valid
d. PASCAL variable name?
10. Errors that occur in a program when the rules of the a. input
programming languages are NOT obeyed are called b. totalCost
c. 9Count
a. Syntax errors d. NumCount
b. Logical errors
c. Execution errors 17. The term used to describe a memory location
d. Run-time errors whose value changes during program execution is
11. Which of the following is NOT a type of program a. constant
error? b. volatile
c. variable
a. Logic error d. dynamic
b. Syntax error
c. Run time error 18. Consider the following algorithm.
d. Debug error
A7
12. Which of the following is not a term used to B9
describe the process of manually going through a AB-A
program looking for errors? BA+B
Write A, B
a. Tracing
b. Dry run The output of this algorithm is
c. Debugging
d. Documentation a. 2, 9
b. 2, 11
13. Which of the following is an example of a
c. 7, 9
conditional construct?
d. 7, 11
a. For-Next 19. Consider the following algorithm
b. If-Then-Else
c. While-Endwhile Sum 0
d. For-Endfor Read a, b
Sum a+b
14. Which of the following reserved words in Pascal
Write Sum
displays data and places the cursor on a new line?
24. Which of the following is NOT a third-generation
In the above algorithm, ‘sum 0’ represents language?
a. a declaration a. Assembly
b. a computation b. COBOL
c. an initialization c. C
d. an assignment d. PASCAL
20. In the programming language Pascal, which of the 25. The Pascal code var x, y would generate an error.
following is NOT a standard data type? The term used to describe this type of error is
for mark := 0 to 2 do
writeln(‘*’);
a. 0
b. 2
c. 3
d. 4
43. The function of a compiler is to convert
a. evaluate solutions
b. test the solution
c. develop the algorithm
d. specify and design
45. The Pascal term used to see results on the printer or
computer monitor is called
a. input
b. read
c. write
d. output
Item 46 is based on the Pascal code below.
Problem Solving & Programming
Answer Section
MULTIPLE CHOICE
1. ANS: C PTS: 1 NOT: CSEC Specimen 2008
2. ANS: C PTS: 1 NOT: CSEC Specimen 2008
3. ANS: C PTS: 1 NOT: CSEC Specimen 2008
4. ANS: A PTS: 1 NOT: CSEC Specimen 2008
5. ANS: A PTS: 1 NOT: CSEC Specimen 2008
6. ANS: D PTS: 1 NOT: CSEC Specimen 2008
7. ANS: A PTS: 1 NOT: CSEC Specimen 2008
8. ANS: B PTS: 1 NOT: CSEC Specimen 2008
9. ANS: C PTS: 1 NOT: CSEC Specimen 2008
10. ANS: A PTS: 1 NOT: CSEC Specimen 2008
11. ANS: D PTS: 1 NOT: CSEC Specimen 2008
12. ANS: D PTS: 1 NOT: CSEC Specimen 2008
13. ANS: B PTS: 1 NOT: CSEC Specimen 2008
14. ANS: C PTS: 1 NOT: CSEC Specimen 2008
15. ANS: B PTS: 1 NOT: CSEC Specimen 2008
16. ANS: C PTS: 1 NOT: CSEC Specimen 2008
17. ANS: C PTS: 1 NOT: CSEC Specimen 2008
18. ANS: B PTS: 1 NOT: CSEC June 2010
19. ANS: C PTS: 1 NOT: CSEC June 2010
20. ANS: A PTS: 1 NOT: CSEC June 2010
21. ANS: D PTS: 1 NOT: CSEC June 2010
22. ANS: A PTS: 1 NOT: CSEC June 2010
23. ANS: B PTS: 1 NOT: CSEC June 2010
24. ANS: A PTS: 1 NOT: CSEC June 2010
25. ANS: D PTS: 1 NOT: CSEC June 2010
26. ANS: C PTS: 1 NOT: CSEC June 2010
27. ANS: B PTS: 1 NOT: CSEC June 2010
28. ANS: C PTS: 1 NOT: CSEC June 2010
29. ANS: C PTS: 1 NOT: CSEC June 2010
30. ANS: A PTS: 1 NOT: CSEC June 2010
31. ANS: B PTS: 1 NOT: CSEC June 2010
32. ANS: C PTS: 1 NOT: CSEC June 2010
33. ANS: C PTS: 1 NOT: CSEC June 2011
34. ANS: D PTS: 1 NOT: CSEC June 2011
35. ANS: D PTS: 1 NOT: CSEC June 2011
36. ANS: C PTS: 1 NOT: CSEC June 2011
37. ANS: B PTS: 1 NOT: CSEC June 2011
38. ANS: C PTS: 1 NOT: CSEC June 2011
39. ANS: D PTS: 1 NOT: CSEC June 2011
40. ANS: D PTS: 1 NOT: CSEC June 2011
41. ANS: B PTS: 1 NOT: CSEC June 2011
42. ANS: C PTS: 1 NOT: CSEC June 2011
43. ANS: B PTS: 1 NOT: CSEC June 2011
44. ANS: C PTS: 1 NOT: CSEC June 2011
45. ANS: C PTS: 1 NOT: CSEC June 2011
46. ANS: B PTS: 1 NOT: CSEC June 2011
47. ANS: B PTS: 1 NOT: CSEC June 2011