Font size
WorksheetsCSM with Visca
Total questions: 40
Worksheet time: 14mins
In a flowchart, a _ shape is used to represent a decision point that usually results in Yes/No or True/False outcomes.
(a)
To calculate the average of three numbers in a flowchart, you must first _ all three numbers before dividing by 3.
(a)
Which flowchart shape is correctly paired with its meaning? A. Rectangle → Input/Output B. Diamond → Decision C. Oval → Process D. Parallelogram → Start/End
Rectangle → Input/Output
Diamond → Decision
Oval → Process
Parallelogram → Start/End
In the 'Determine Street Direction in NYC' example, if the street number is odd, the program should display "Westbound". What shape will be used for the display?
(a)
Why are flowcharts particularly helpful for non-programmers? A. They allow running programs without a computer. B. They represent processes visually with symbols and arrows. C. They are faster to execute than code. D. They eliminate the need for input data.
They allow running programs without a computer.
They represent processes visually with symbols and arrows.
They are faster to execute than code.
They eliminate the need for input data.
When designing a flowchart for a login system with multiple attempts, which looping structure should be used? Briefly explain.
Which sequence correctly represents the steps for 'Add Two Numbers' in a flowchart? A. START → DISPLAY sum → INPUT numbers → END B. START → INPUT numbers → sum = num1 + num2 → DISPLAY sum → END C. INPUT numbers → START → DISPLAY sum → END D. START → sum = num1 + num2 → DISPLAY sum → END
START → DISPLAY sum → INPUT numbers → END
START → INPUT numbers → sum = num1 + num2 → DISPLAY sum → END
INPUT numbers → START → DISPLAY sum → END
START → sum = num1 + num2 → DISPLAY sum → END
In flowcharts, a/an _ shows the direction of flow from one step to the next.
(a)
Which flowchart would you use to represent a program that reads two numbers and prints the largest? A. Linear flowchart with no decision B. Flowchart including a diamond decision symbol C. Flowchart using only rectangles D. Flowchart using only ovals
Linear flowchart with no decision
Flowchart including a diamond decision symbol
Flowchart using only rectangles
Flowchart using only ovals
The main advantage of using flowcharts before coding is that they help _ the steps and logic of the program before implementation.
(a)
In a WHILE loop, the condition is checked _ the loop body executes.
(a)
Which scenario is best suited for a DO...WHILE loop? A. Processing an unknown number of data items only if data exists B. Asking the user for input at least once before validation C. Printing numbers from 1 to 100 D. Calculating the sum of a known set of numbers
Processing an unknown number of data items only if data exists
Asking the user for input at least once before validation
Printing numbers from 1 to 100
Calculating the sum of a known set of numbers
A FOR loop is ideal when the _ of _ is known in advance.
Consider the following pseudocode: num = 6 DO PRINT num num = num + 1 WHILE num <= 5 What is printed? A. Nothing B. 6 C. 1 to 6 D. Infinite numbers
Nothing
6
1 to 6
Infinite numbers
Using a loop reduces code duplication, improves maintainability, and prevents _ errors.
(a)
Which statement correctly contrasts WHILE and DO...WHILE loops? A. WHILE runs at least once; DO...WHILE may run zero times B. WHILE checks after execution; DO...WHILE checks before execution C. WHILE may not run if the condition is false; DO...WHILE always runs at least once D. WHILE is only for FOR loops; DO...WHILE is only for WHILE loops
WHILE runs at least once; DO...WHILE may run zero times
WHILE checks after execution; DO...WHILE checks before execution
WHILE may not run if the condition is false; DO...WHILE always runs at least once
WHILE is only for FOR loops; DO...WHILE is only for WHILE loops
In a FOR loop, counter = start to end step increment defines the _, the number of iterations, and how the counter changes each time.
Which loop type is most suitable for printing the first 10 even numbers? A. FOR loop B. WHILE loop C. DO...WHILE loop D. Any of the above, depending on implementation
FOR loop
WHILE loop
DO...WHILE loop
Any of the above, depending on implementation
A major best practice when using loops is to always ensure the loop has a _ to prevent infinite execution.
Which of the following pseudocode snippets is an infinite loop? A. num = 1 WHILE num <= 5 PRINT num num = num + 1 END WHILE B. DO INPUT x WHILE x != 0 C. FOR i = 1 TO 10 PRINT i ENDFOR D. WHILE TRUE PRINT 'Hello'
num = 1 WHILE num <= 5 PRINT num num = num + 1 END WHILE
DO INPUT x WHILE x != 0
FOR i = 1 TO 10 PRINT i ENDFOR
WHILE TRUE PRINT 'Hello'
An algorithm must exhibit _ to ensure it completes in a finite number of steps.
(a)
Which pseudocode statement correctly assigns a value to a variable? A. INPUT x B. x = 5 C. PRINT x D. IF x > 5 THEN
INPUT x
x = 5
PRINT x
IF x > 5 THEN
The attribute of algorithms that ensures each instruction is clear and precise is called _.
(a)
Which scenario violates the 'Generality' attribute of an algorithm? A. The algorithm stops after 5 steps B. The algorithm only works for numbers 1–5 C. The algorithm prints the result D. The algorithm uses a loop to sum numbers
The algorithm stops after 5 steps
The algorithm only works for numbers 1–5
The algorithm prints the result
The algorithm uses a loop to sum numbers
For an algorithm to be effective, it should be basic, executable, and capable of producing a result in a _ number of steps.
(a)
In the 'Convert Celsius to Fahrenheit' pseudocode, which step represents Output? A. INPUT celsius B. fahrenheit = (celsius * 9/5) + 32 C. PRINT fahrenheit D. STOP
INPUT celsius
fahrenheit = (celsius * 9/5) + 32
PRINT fahrenheit
STOP
When testing an algorithm manually to ensure definiteness, you check whether every step is _ and unambiguous.
(a)
Kwame wrote an algorithm that adds two numbers forever without stopping. Which attribute is missing? A. Finiteness B. Definiteness C. Generality D. Input/Output Capability
Finiteness
Definiteness
Generality
Input/Output Capability
A pseudocode program that correctly reads a number, calculates its square, and prints it demonstrates proper use of _, _, and _ steps.
Which of the following is NOT a common pseudocode keyword for Input operations? A. READ B. GET C. INPUT D. PRINT
READ
GET
INPUT
Which of the following pseudocode snippets correctly demonstrates a conditional statement? A. IF x > 10 THEN PRINT 'Greater' B. WHILE x < 10 PRINT x C. FOR i = 1 TO 5 PRINT i ENDFOR D. DO PRINT x WHILE x < 10
FOR i = 1 TO 5 PRINT i ENDFOR
WHILE x < 10 PRINT x
IF x > 10 THEN PRINT 'Greater'
DO PRINT x WHILE x < 10
What is the primary purpose of a flowchart in programming? A. To execute code directly B. To visualize the logic of an algorithm C. To store data D. To compile programs
To visualize the logic of an algorithm
To compile programs
To store data
To execute code directly
In the context of algorithms, what does 'Definiteness' refer to? A. The algorithm must have a clear end B. Each step must be precisely defined C. The algorithm must be applicable to multiple problems D. The algorithm must produce an output
The algorithm must have a clear end
Each step must be precisely defined
The algorithm must be applicable to multiple problems
The algorithm must produce an output
Which of the following correctly describes the 'Input' step in a flowchart? A. The process of displaying results B. The action of receiving data from the user C. The step where calculations are performed D. The final step of the algorithm
The step where calculations are performed
The action of receiving data from the user
The final step of the algorithm
The process of displaying results
What is the main difference between a 'FOR' loop and a 'WHILE' loop? A. FOR loops are used for infinite iterations B. WHILE loops require a counter variable C. FOR loops are generally used when the number of iterations is known D. WHILE loops cannot be used for counting
FOR loops are used for infinite iterations
WHILE loops cannot be used for counting
WHILE loops require a counter variable
FOR loops are generally used when the number of iterations is known
In a flowchart, which shape is used to represent a process? A. Diamond B. Rectangle C. Oval D. Parallelogram
Oval
Rectangle
Parallelogram
Diamond
Which of the following pseudocode keywords is commonly used for output operations? A. DISPLAY B. OUTPUT C. PRINT D. SHOW
SHOW
OUTPUT
DISPLAY
In a flowchart, what does the diamond shape typically represent? A. Start/End B. Process C. Input/Output D. Decision
Decision
Input/Output
Process
Start/End
What is the main characteristic of a 'FOR' loop compared to a 'WHILE' loop? A. FOR loops are used for indefinite iterations B. WHILE loops require a specific number of iterations C. FOR loops are typically used when the number of iterations is known D. WHILE loops are always faster
FOR loops are used for indefinite iterations
WHILE loops require a specific number of iterations
WHILE loops are always faster
FOR loops are typically used when the number of iterations is known
How's preparations towards the CSM 184 exam going?
Be sincere 😋
