Computer Science Quiz: Pseudocode (Year 10)
Instructions
Answer the following questions related to pseudocode. Select the correct answer from the options provided where applicable.
Questions
- The image of a simple flowchart that depicts a process where a user inputs a number, checks if the number is even or odd, and displays the result.
- What is the purpose of pseudocode in programming?
A. To execute the code
B. To design algorithms in a readable manner
C. To create graphical user interfaces
D. To compile programming languages
- The image of a series of steps outlined in rectangles, diamonds, and arrows showing the logic of a "Guess the Number" game.
- What does a diamond shape represent in pseudocode flowcharts?
A. Start or End
B. Process step
C. Decision point
D. Input/Output operation
- The image of an algorithm that reads user input and sums numbers until the user enters zero.
- Explain the purpose of a loop in this pseudocode.
(Answer in a few sentences)
- The image of a table listing variable names, their data types, and example values such as "age", "string", "25".
- Which of the following describes a variable in programming?
A. A constant value that doesn't change
B. A named storage location that holds data
C. An error in the code
D. A command to print output
- The image of an assignment operation where a variable "total" is set to the sum of "x" and "y".
- In the line
total = x + y, what is total?
- (Answer in a few sentences)
- The image of a decision-making scenario where the user can choose between multiple options displayed in a list.
- Which of the following is an example of conditional pseudocode?
A. Print "Welcome!"
B. If x > 10 then print "High" else print "Low"
C. For i from 1 to 5 do print i
D. Input name
- The image of a loop structure indicating repeated iterations with a counter that starts from 1 to 10.
- What type of loop is often represented in pseudocode for repeating a certain number of times?
A. While loop
B. For loop
C. Do-while loop
D. Infinite loop
- The image of a structure that shows an input/output symbol and the associated actions in pseudocode.
- Why are input and output operations important in pseudocode?
(Answer in a few sentences)
- The image of a comparison operation that checks whether
a is greater than b.
- What is the correct way to write this comparison in pseudocode?
A. If (a > b)
B. If a > b then
C. Compare a and b
D. Set a > b
- The image of a structured pseudocode that sorts a list of numbers.
- Describe what the pseudocode represents and its significance in programming.
(Answer in a few sentences)
Correct Answers
- B
- C
- (Explanation provided by the student)
- B
- (Explanation provided by the student)
- B
- B
- (Explanation provided by the student)
- A
- (Explanation provided by the student)
Good luck!