Quiz 2 Name:
_____________________
CPSC 110 ID:
________________________
(c)opyright 2002 Brent M. Dingle Section:
____________________
TA:
________________________
INSTRUCTIONS:
All answers should be PRINTED. If I am not able to easily
read the answer, you will NOT receive any credit for it. Please use a PENCIL
and an eraser (if/when needed).
1. |
True or
False |
A compiler can detect syntax and logical errors. |
|
|
|
2. |
True or
False |
In DOS, the character ‘?’ is a wild character. |
|
|
|
3. |
True or
False |
DOS directories are tree structured. |
|
|
|
4. |
True or
False |
Blaise Pascal is the original creator of the Pascal
programming language. |
|
|
|
5. |
True or
False |
A variable name may have spaces in it. |
|
|
|
6. |
True or
False |
A variable of type integer has NO maximum value that it
can contain. |
|
|
|
7. |
True or
False |
A floppy disk is one example of the main memory used in a computer. |
|
|
|
8. |
True or
False |
Every IF statement must have an ELSE following it. |
|
|
|
9. |
True or
False |
The result of 7 MOD 3 is 2. |
|
|
|
10. |
True or
False |
The decimal equivalent of the binary number 1011 is 11. |
Answer 11: |
A |
B |
C |
D |
E |
a. The hard disk on which the program was saved.
b. A printout of the program.
c. A CD-ROM with the source code burned on it.
d. A 3 1/2 inch floppy disk with the program saved on it.
e. A picture of the program's output.
Answer 12: |
A |
B |
C |
D |
E |
a. an order set
b. a solution set
c. a procedure
d. an algorithm
e. an implementation
Answer 13: |
A |
B |
C |
D |
E |
a. 16
b. 8
c. 6
d. 4
e. 2
Answer 14: |
A |
B |
C |
D |
E |
a. sum
b. average
c. next
d. first
e. program
Answer 15: |
A |
B |
C |
D |
E |
PROGRAM Shrug;
VAR
num : integer;
BEGIN
Randomize;
num := Random(100);
Writeln(num);
END.
count := 0;
A := 1;
B := 1;
while (count <= 4) do
BEGIN
count := count + 1;
B := B + 1;
A := A + B - count;
write(A, ' '); { there is a space between those single quotes }
END;
(hint: excluding
comments the first word of a Pascal program is PROGRAM)
(and if you make a minor syntax error don’t worry about it)