WorksheetsPseudocode, Dry runs, Trace Tables and other revision
Total questions: 156
Worksheet time: 2hrs 31mins
Name
Class
Date
1.
The following pseudocode attempts to decrypt a Caesar cipher with key=5:
asciicode ← CHAR_TO_INT(ciphertextcharacter)
asciicode ← asciicode - 5
plaintextcharacter ← INT_TO_CHAR(asciicode)
What is the problem with this algorithm?
a)
It works correctly for all letters
b)
It fails when decrypting letters A-E as they go below ASCII 65
c)
It adds 5 instead of subtracting
d)
It only works for lowercase letters
2.
For the Caesar cipher decryption with key=5, if we decrypt the letter 'C' (ASCII 67), what ASCII code do we get and why is this wrong?
a)
62, which is below 'A'
b)
72, which is 'H'
c)
90, which is 'Z'
d)
67, stays the same
3.
Given these arrays:
Data = ['U','K','Y','H','M']
Dir1 = [1, 2, -1, -1, -1]
Dir2 = [4, 3, -1, -1, -1]
Trace this algorithm step-by-step:
Done ← False
Pos ← -1
Current ← 0
WHILE Done = False
WHILE Current ≠ -1
Pos ← Pos + 1
Temp[Pos] ← Current
Current ← Dir1[Current]
ENDWHILE
IF Pos = -1 THEN
Done ← True
ELSE
OUTPUT Data[Temp[Pos]]
Current ← Dir2[Temp[Pos]]
Pos ← Pos - 1
ENDIF
ENDWHILE
What is the FIRST OUTPUT?
a)
U
b)
K
c)
Y
d)
H
4.
Continuing the same trace table, after outputting 'Y', what happens to Pos and Current?
a)
Pos=1, Current=-1
b)
Pos=2, Current=4
c)
Pos=1, Current=3
d)
Pos=0, Current=4
5.
What is a recursive subroutine?
a)
A subroutine that repeats indefinitely
b)
A subroutine that calls itself
c)
A subroutine with multiple loops
d)
A subroutine that calls other subroutines
6.
What essential component must every recursive algorithm have to avoid infinite recursion?
a)
A loop
b)
A base case (stopping condition)
c)
An array parameter
d)
A counter variable
7.
What THREE items are typically stored in a stack frame for a subroutine call?
a)
Only parameters
b)
Return address, parameters, and local variables
c)
Only return address
d)
Global variables and parameters
8.
For recursive call MergeSort(list, 1, 4), if it recursively divides until base case, what is the maximum depth of stack frames?
a)
2
b)
3
c)
4
d)
5
9.
A binary tree is represented using three arrays: Data, Dir1, Dir2. If Data[0]='C', Dir1[0]=1, Dir2[0]=4, what do Dir1 and Dir2 represent?
a)
Left child index and right child index
b)
Parent and sibling indices
c)
Previous and next node indices
d)
Start and end of subtree
10.
Given: Data[0]='C', Dir1[0]=1, Dir2[0]=4, Data[1]='I', Data[4]='B'. What is the tree structure?
a)
C is root, I is left child, B is right child
b)
I is root, C and B are children
c)
B is root
d)
All are siblings
11.
For binary tree: C(root) with left child I and right child B; I has left child E and right child H; B has left child Y and right child Q.
If post-order traversal gives: E, H, I, Y, Q, B, C
What does in-order traversal give?
a)
E, I, H, C, Y, B, Q
b)
C, I, E, H, B, Y, Q
c)
E, H, I, Y, Q, B, C
d)
Y, B, Q, C, E, I, H
12.
What order does pre-order traversal visit nodes?
a)
Left, Root, Right
b)
Root, Left, Right
c)
Left, Right, Root
d)
Right, Root, Left
13.
What is the Big-O time complexity of Bubble Sort?
a)
O(n)
b)
O(n log n)
c)
O(n²)
d)
O(log n)
14.
What is the Big-O time complexity of Merge Sort?
a)
O(n)
b)
O(n log n)
c)
O(n²)
d)
O(2ⁿ)
15.
What is the Big-O time complexity of Linear Search?
a)
O(1)
b)
O(n)
c)
O(log n)
d)
O(n²)
16.
Why does Binary Search have O(log n) time complexity?
a)
It checks every element
b)
It halves the search space with each comparison
c)
It uses two loops
d)
It sorts the data first
17.
What does this pseudocode output?
x ← 10
y ← 5
z ← x MOD y
OUTPUT z
a)
2
b)
0
c)
5
d)
15
18.
What does this pseudocode output?
count ← 0
FOR i ← 1 TO 4
count ← count + i
ENDFOR
OUTPUT count
a)
4
b)
10
c)
15
d)
20
19.
What does this pseudocode output?
x ← 7
IF x > 5 AND x < 10 THEN
OUTPUT "Valid"
ELSE
OUTPUT "Invalid"
ENDIF
a)
Valid
b)
Invalid
c)
7
d)
Error
20.
What does DIV operation return in pseudocode (e.g., 17 DIV 5)?
a)
Remainder (2)
b)
Integer quotient (3)
c)
Decimal result (3.4)
d)
Both quotient and remainder
21.
An array arr has 5 elements with valid indices [0] to [4]. What happens when accessing arr[5]?
a)
Returns 0
b)
Returns arr[0]
c)
Index out of bounds error
d)
Returns arr[4]
22.
Given arr = ['A', 'B', 'C', 'D', 'E'], what does arr[2] return?
a)
A
b)
B
c)
C
d)
D
23.
What does this pseudocode output?
x ← 1
WHILE x < 5
x ← x + 2
ENDWHILE
OUTPUT x
a)
4
b)
5
c)
6
d)
3
24.
How many times does this loop execute?
x ← 10
WHILE x > 0
x ← x - 3
ENDWHILE
a)
3
b)
4
c)
5
d)
Infinite
25.
How many times is OUTPUT executed?
FOR i ← 1 TO 3
FOR j ← 1 TO 2
OUTPUT i * j
ENDFOR
ENDFOR
a)
3
b)
6
c)
5
d)
9
26.
What values are output by this nested loop?
FOR i ← 1 TO 2
FOR j ← 1 TO 2
OUTPUT i + j
ENDFOR
ENDFOR
a)
2, 3, 3, 4
b)
1, 2, 2, 3
c)
2, 2, 3, 3
d)
1, 1, 2, 2
27.
What does this output?
a ← True
b ← False
OUTPUT a AND b
a)
True
b)
False
c)
0
d)
1
28.
What does this output?
a ← False
b ← False
OUTPUT a OR b
a)
True
b)
False
c)
Error
d)
0
29.
What does NOT True evaluate to?
a)
True
b)
False
c)
0
d)
1
30.
What does this output?
str ← "HELLO"
OUTPUT str[0]
a)
H
b)
E
c)
HELLO
d)
Error
31.
What does LEN("CODE") return?
a)
3
b)
4
c)
5
d)
CODE
32.
What does SUBSTRING("PYTHON", 2, 2) return (starting at index 2, length 2)?
a)
PY
b)
YT
c)
TH
d)
HO
33.
Complete trace: x ← 5, y ← 3, x ← x + y, y ← x - y. What is final y?
a)
3
b)
5
c)
8
d)
2
34.
Trace: sum ← 0, FOR i ← 2 TO 5, sum ← sum + i, ENDFOR. What is final sum?
a)
10
b)
14
c)
15
d)
11
35.
A stack contains [Bottom: Harry, Skye, Jib :Top]. After one POP operation, what is at the top?
a)
Harry
b)
Skye
c)
Jib
d)
Stack is empty
36.
What principle does a stack follow?
a)
FIFO (First In First Out)
b)
LIFO (Last In First Out)
c)
Random Access
d)
Priority-based
37.
Which operations are standard for a stack?
a)
PUSH, POP, PEEK
b)
ENQUEUE, DEQUEUE
c)
INSERT, DELETE
d)
ADD, REMOVE
38.
What principle does a queue follow?
a)
LIFO
b)
FIFO
c)
Random Access
d)
Sorted order
39.
What advantage does a circular queue have over a linear queue?
a)
Faster operations
b)
Can reuse freed space at front
c)
Stores more data
d)
Simpler to implement
40.
To add item to linear queue (enqueue), what steps are needed?
a)
Check if full, increment rear pointer, add item at rear
b)
Add item, increment front pointer
c)
Check if empty, add item
d)
Increment both pointers, add item
41.
What is an advantage of dynamic data structures over static?
a)
Faster access by index
b)
Can grow/shrink as needed during runtime
c)
Simpler to implement
d)
Always use less memory
42.
What is an advantage of static data structures (arrays) over dynamic?
a)
Can grow infinitely
b)
Direct O(1) access via index
c)
Use pointers for flexibility
d)
More memory efficient
43.
For a graph with 4 nodes, what size adjacency matrix is needed?
a)
4×4
b)
4×2
c)
2×4
d)
4×1
44.
In an adjacency list representation, what does each index represent?
a)
An edge
b)
A node and its list of connected nodes
c)
A path
d)
A weight
45.
For a sparse graph (few edges), which is more space-efficient?
a)
Adjacency matrix
b)
Adjacency list
c)
Both equal
d)
Depends on implementation
46.
What prerequisite does binary search absolutely require?
a)
Unsorted data
b)
Sorted data
c)
Even number of elements
d)
No duplicate values
47.
Linear search with n=100 elements: worst-case, how many comparisons?
a)
1
b)
50
c)
100
d)
7
48.
Binary search with n=16 sorted elements: maximum comparisons needed?
a)
4
b)
5
c)
8
d)
16
49.
What is a dry run of an algorithm?
a)
Running compiled code
b)
Manually tracing execution with test data
c)
Writing pseudocode
d)
Optimizing for speed
50.
What is the purpose of a trace table?
a)
Store final output
b)
Track variable values step-by-step during execution
c)
Display user interface
d)
Store input data
51.
How does bubble sort work?
a)
Divides array recursively
b)
Repeatedly swaps adjacent elements if in wrong order
c)
Finds minimum each pass
d)
Uses divide and conquer
52.
After ONE complete pass of bubble sort on [5,2,8,1,9], what is guaranteed?
a)
Array fully sorted
b)
Largest element (9) in final position
c)
Smallest element (1) in final position
d)
First two elements sorted
53.
What algorithmic approach does merge sort use?
a)
Greedy
b)
Divide and Conquer
c)
Dynamic Programming
d)
Brute Force
54.
What is the key operation in merge sort?
a)
Swapping adjacent elements
b)
Merging two sorted arrays into one sorted array
c)
Finding pivot element
d)
Comparing all pairs
55.
What is a local variable?
a)
Accessible throughout entire program
b)
Only accessible within its function/procedure
c)
Permanently stored
d)
Same as global variable
56.
What is a global variable?
a)
Only in main program
b)
Accessible from anywhere in program
c)
Temporary variable
d)
Only in one function
57.
What is a parameter in programming?
a)
A return value
b)
A value passed into a function
c)
A local variable
d)
A constant
58.
What distinguishes a function from a procedure?
a)
Functions are faster
b)
Functions return a value, procedures don't
c)
Procedures cannot have parameters
d)
Functions cannot have parameters
59.
What is string concatenation?
a)
Joining strings together
b)
Comparing strings
c)
Splitting strings
d)
Converting data types
60.
What does "ABC" + "123" produce?
a)
ABC
b)
123
c)
ABC123
d)
Error
61.
What are the two main types of files programs read?
a)
Small and large
b)
Text and binary
c)
Input and output
d)
System and user
62.
What distinguishes text files from binary files?
a)
File size only
b)
Text is human-readable, binary uses machine code
c)
Binary files are faster
d)
Text files are compressed
63.
Why use named constants instead of literal values in code?
a)
Faster execution
b)
Improves code readability and maintainability
c)
Uses less memory
d)
Required by compiler
64.
A subroutine uses the value 5 repeatedly. What is best practice?
a)
Use literal 5 each time
b)
Create named constant GRID_SIZE = 5
c)
Use variable
d)
Use global variable
65.
What defines an intractable problem?
a)
Has no solution
b)
Cannot be solved in reasonable time for large inputs
c)
Easy to solve
d)
Has multiple solutions
66.
Which time complexity indicates intractability?
a)
O(n)
b)
O(n²)
c)
O(2ⁿ)
d)
O(n log n)
67.
What are heuristics used for in computing?
a)
Finding exact optimal solutions
b)
Finding good-enough solutions to intractable problems quickly
c)
Sorting algorithms
d)
Data validation
68.
What trade-off do heuristic algorithms make?
a)
Speed for memory
b)
Optimality for speed/feasibility
c)
Accuracy for simplicity
d)
Memory for CPU
69.
What does O(1) constant time complexity mean?
a)
Takes exactly 1 second
b)
Execution time independent of input size
c)
Executes exactly 1 operation
d)
Always fastest possible
70.
Which operation has O(1) time complexity?
a)
Linear search
b)
Accessing array element by index arr[i]
c)
Sorting array
d)
Binary search
71.
Why is searching considered a tractable problem?
a)
Always instant
b)
Can be solved in polynomial time (O(n) or O(log n))
c)
Uses simple code
d)
Requires no memory
72.
Calculate: 17 DIV 5
a)
2
b)
3
c)
3.4
d)
2 remainder 2
73.
Calculate: 17 MOD 5
a)
2
b)
3
c)
3.4
d)
12
74.
Calculate: 20 MOD 4
a)
0
b)
4
c)
5
d)
16
75.
Evaluate: 5 != 5
a)
True
b)
False
c)
5
d)
Error
76.
Evaluate: 10 >= 10
a)
True
b)
False
c)
10
d)
Error
77.
After x ← 5 then x ← x + 3, what is x?
a)
5
b)
8
c)
3
d)
53
78.
Trace: a ← 10, b ← a, a ← 20. What is b?
a)
10
b)
20
c)
30
d)
Error
79.
What outputs: x ← 5, IF x < 3 THEN OUTPUT "A" ELSE OUTPUT "B" ENDIF?
a)
A
b)
B
c)
AB
d)
Error
80.
What outputs: IF 10 > 5 AND 5 > 10 THEN OUTPUT "Yes" ELSE OUTPUT "No" ENDIF?
a)
Yes
b)
No
c)
YesNo
d)
Error
81.
What outputs: arr ← [1,2,3], sum ← 0, FOR i ← 0 TO 2: sum ← sum + arr[i], ENDFOR, OUTPUT sum?
a)
3
b)
6
c)
5
d)
Error
82.
To swap values of variables a and b, what is needed?
a)
Just: a ← b, b ← a
b)
temp ← a, a ← b, b ← temp
c)
a ← b + a, b ← a - b
d)
Direct swap without temp
83.
To find maximum in arr = [3,7,2,9,4], which approach is correct?
a)
max ← 0, then compare each element
b)
max ← arr[0], then compare each element
c)
max ← 999, then compare each
d)
Sort array, take last element
84.
Linear search for 8 in arr = [5,3,8,1]. How many comparisons until found?
a)
1
b)
2
c)
3
d)
4
85.
Count even numbers in arr = [1,2,3,4,5,6]. What is the count?
a)
2
b)
3
c)
4
d)
6
86.
What programming pattern is: sum ← 0, FOR i ← 1 TO n: sum ← sum + i, ENDFOR?
a)
Counter pattern
b)
Accumulator pattern
c)
Flag pattern
d)
Sentinel pattern
87.
What is a sentinel value?
a)
First value in list
b)
Special value marking end of input
c)
Maximum possible value
d)
Default initialization value
88.
What is a flag variable in programming?
a)
Stores numeric data
b)
Boolean tracking whether condition occurred
c)
Array index
d)
Named constant
89.
What outputs: x←7, IF x>5 THEN IF x<10 THEN OUTPUT "A" ELSE OUTPUT "B" ENDIF ELSE OUTPUT "C" ENDIF?
a)
A
b)
B
c)
C
d)
AB
90.
How does selection sort work?
a)
Find minimum in unsorted portion, swap to front, repeat
b)
Swap adjacent pairs
c)
Divide and conquer
d)
Insert elements in sorted portion
91.
How does insertion sort work?
a)
Find minimum each pass
b)
Take each element, insert into correct position in sorted portion
c)
Divide array in half
d)
Bubble largest to end
92.
Calculate factorial(4). How many recursive calls total (including initial)?
a)
3
b)
4
c)
5
d)
6
93.
For factorial function, what is the typical base case?
a)
n = 1 only
b)
n = 0 or n = 1
c)
n = 10
d)
n < 0
94.
A 2D array declared as arr[3][2] has how many elements total?
a)
3
b)
5
c)
6
d)
8
95.
In arr[i][j], what does i represent by convention?
a)
Column index
b)
Row index
c)
Value
d)
Array size
96.
For searching in sorted data, which is most efficient?
a)
Linear search O(n)
b)
Binary search O(log n)
c)
Bubble sort O(n²)
d)
They're equal
97.
What data structure does BFS (Breadth-First Search) use?
a)
Stack
b)
Queue
c)
Array
d)
Linked list
98.
What data structure does DFS (Depth-First Search) use?
a)
Queue
b)
Stack (or recursion)
c)
Array
d)
Hash table
99.
What problem does Dijkstra's algorithm solve?
a)
Sorting arrays
b)
Shortest path in weighted graph
c)
Tree traversal
d)
Pattern matching
100.
What is the purpose of a hash function?
a)
Sort data
b)
Convert key to array index
c)
Search data linearly
d)
Encrypt data
101.
What is a collision in a hash table?
a)
Two keys hash to same index
b)
Hash function error
c)
Table overflow
d)
Key not found
102.
What does each node in a singly linked list contain?
a)
Data only
b)
Data and pointer to next node
c)
Index only
d)
Data and array position
103.
What advantage does linked list have over array?
a)
Faster index access
b)
Dynamic size, easy insertion/deletion
c)
Uses less memory always
d)
Simpler implementation
104.
How does priority queue determine which item to dequeue?
a)
FIFO order
b)
LIFO order
c)
Based on priority value (highest/lowest first)
d)
Random selection
105.
In Binary Search Tree (BST), where are smaller values relative to a node?
a)
Right subtree
b)
Left subtree
c)
Parent
d)
Root
106.
What is average time complexity of search in balanced BST?
a)
O(1)
b)
O(log n)
c)
O(n)
d)
O(n²)
107.
What is input validation?
a)
Encrypting user input
b)
Checking input meets requirements before processing
c)
Storing input to file
d)
Displaying input to user
108.
What is a range check in validation?
a)
Check string length
b)
Check value is between minimum and maximum
c)
Check data type
d)
Check not empty
109.
What is exception handling in programming?
a)
Preventing all errors
b)
Catching and managing runtime errors gracefully
c)
Debugging during development
d)
Testing code
110.
What is a key benefit of modular programming?
a)
Faster execution always
b)
Easier to test, debug, and maintain
c)
Uses less memory
d)
More complex
111.
For n=1000 elements, which completes fastest?
a)
O(n²) algorithm
b)
O(n log n) algorithm
c)
O(n) algorithm
d)
O(2ⁿ) algorithm
112.
What does UPPER("hello") return?
a)
hello
b)
HELLO
c)
Hello
d)
hELLO
113.
What does LOWER("WORLD") return?
a)
WORLD
b)
world
c)
World
d)
wORLD
114.
RANDOM(1, 6) generates integers in what range?
a)
0 to 5
b)
1 to 6 inclusive
c)
1 to 5
d)
0 to 6
115.
What does ROUND(4.7) return?
a)
4
b)
5
c)
4.7
d)
Error
116.
What does TRUNCATE(4.9) or INT(4.9) return?
a)
4
b)
5
c)
4.9
d)
Error
117.
What does INT("42") or STR_TO_INT("42") return?
a)
"42" (string)
b)
42 (integer)
c)
Error
d)
42.0 (float)
118.
What does STR(42) or INT_TO_STR(42) return?
a)
42 (integer)
b)
"42" (string)
c)
42.0
d)
Error
119.
To read a text file line by line, what loop structure is typically used?
a)
FOR loop with fixed count
b)
WHILE NOT EOF (End Of File)
c)
IF statement
d)
REPEAT UNTIL
120.
What are parallel arrays?
a)
2D arrays
b)
Multiple 1D arrays with related data at same index
c)
Arrays processed simultaneously
d)
Sorted arrays
121.
What advantage do records/structures have over parallel arrays?
a)
Faster access
b)
Logically groups related data together
c)
Uses less memory
d)
Simpler syntax
122.
What is an Abstract Data Type (ADT)?
a)
Specific implementation
b)
Logical description of data and operations (not implementation)
c)
Programming language
d)
File format
123.
What is polymorphism in OOP?
a)
Multiple inheritance
b)
Same operation behaves differently for different types
c)
Inheritance only
d)
Encapsulation
124.
What is encapsulation in OOP?
a)
Data compression
b)
Bundling data with methods, hiding internal details
c)
Inheritance
d)
Polymorphism
125.
What is inheritance in OOP?
a)
Variable scope rules
b)
Child class inherits attributes/methods from parent
c)
Memory management
d)
File operations
126.
What is the purpose of test data in programming?
a)
Store program results
b)
Verify algorithm correctness with various inputs
c)
Document code
d)
Optimize performance
127.
For input validation allowing 1-100, which are good boundary test values?
a)
50, 75 only
b)
0, 1, 100, 101
c)
1, 100 only
d)
50 only
128.
What is desk checking?
a)
Running compiled code
b)
Manual review and trace before execution
c)
Automated unit testing
d)
Performance profiling
129.
In pseudocode, what does the ← symbol represent?
a)
Comparison
b)
Assignment
c)
Less than
d)
Arrow
130.
What characterizes an infinite loop?
a)
Very long loop
b)
Loop condition never becomes false
c)
Nested loop
d)
Loop executing once
131.
What does BREAK statement do in a loop?
a)
Pause execution
b)
Exit loop immediately
c)
Skip to next iteration
d)
Restart loop
132.
What does CONTINUE statement do in a loop?
a)
Exit loop
b)
Skip rest of current iteration, proceed to next
c)
Restart loop
d)
Pause
133.
When should you use a function instead of a procedure?
a)
When producing output
b)
When computing and returning a value
c)
When using parameters
d)
Always
134.
What happens with pass by value?
a)
Pass variable's memory address
b)
Pass copy of value
c)
Pass variable name
d)
Pass pointer
135.
What happens with pass by reference?
a)
Pass copy of value
b)
Pass memory address/reference to original
c)
Pass literal value
d)
Pass constant
136.
What is a default parameter?
a)
Required parameter
b)
Parameter with preset value used if not provided
c)
First parameter
d)
Return value
137.
What does space complexity measure?
a)
Execution time
b)
Memory usage as function of input size
c)
Code length in lines
d)
CPU cycles
138.
What is worst-case time complexity?
a)
Fastest scenario
b)
Maximum time for any input of size n
c)
Average scenario
d)
Typical scenario
139.
What makes a sorting algorithm stable?
a)
Never crashes
b)
Preserves relative order of equal elements
c)
Always fast
d)
Uses minimal memory
140.
What is an in-place algorithm?
a)
Very fast
b)
Uses O(1) extra space, modifies input directly
c)
Always correct
d)
Runs on local machine
141.
What characterizes a greedy algorithm?
a)
Uses most memory
b)
Makes locally optimal choice at each step
c)
Tries all possibilities
d)
Uses only recursion
142.
What defines divide and conquer strategy?
a)
Use loops
b)
Split problem into subproblems, solve recursively, combine
c)
Try all options
d)
Make greedy choices
143.
What is memoization?
a)
Taking notes
b)
Caching results to avoid recomputing
c)
Memory allocation
d)
Data compression
144.
What is tail recursion?
a)
Last function defined
b)
Recursive call is final operation
c)
Recursion at start
d)
Maximum recursion depth
145.
What causes stack overflow error?
a)
Array full
b)
Stack data structure full
c)
Too many recursive calls exceeding stack memory
d)
Heap full
146.
How can bubble sort be optimized?
a)
Use recursion
b)
Stop early if no swaps occur in a pass
c)
Use more memory
d)
Compare non-adjacent elements
147.
What is the key operation in quick sort?
a)
Merging
b)
Selecting pivot, partitioning around it
c)
Swapping adjacent
d)
Finding minimum
148.
Why check array bounds before accessing?
a)
Improve speed
b)
Prevent index out of bounds error/crash
c)
Save memory
d)
Required syntax
149.
What does NULL or None represent?
a)
Zero
b)
Absence of value / no reference
c)
Empty string
d)
False
150.
What is short-circuit evaluation in boolean expressions?
a)
Quick calculation
b)
Stop evaluating once result is determined
c)
Shortened code
d)
Fast loop
151.
What is an off-by-one error?
a)
Rounding error
b)
Loop iterates one too many or too few times
c)
Typo in variable name
d)
Wrong arithmetic operator
152.
How to verify algorithm correctness thoroughly?
a)
Run once
b)
Test with normal, boundary, and invalid test cases
c)
Check syntax only
d)
Time execution
153.
What is a priming read in input processing?
a)
Fast reading
b)
Initial read before loop to enable condition check
c)
Reading all data at once
d)
Reading in reverse
154.
What is the first step in algorithm design?
a)
Write code
b)
Understand problem, inputs, outputs, constraints
c)
Choose data structures
d)
Write tests
155.
What is a logic error?
a)
Syntax mistake
b)
Code runs but produces wrong results
c)
Compilation error
d)
Missing semicolon
156.
Why is documentation important in pseudocode and programs?
a)
Makes code run faster
b)
Explains logic for maintenance and understanding
c)
Required for compilation
d)
Reduces memory usage
100 %
