A.
Introduction to Algorithms (10 MCQs)
1. Which of the following best describes an algorithm?
A. A programming language
B. A step-by-step procedure to solve a problem
C. A type of computer hardware
D. A flowchart symbol
2. A good algorithm should be:
A. Ambiguous
B. Unstructured
C. Precise and finite
D. Unpredictable
3. Which feature is not required in an algorithm?
A. Input
B. Output
C. Infinite looping
D. Definiteness
4. Which step of problem-solving comes before designing an algorithm?
A. Testing
B. Understanding the problem
C. Coding
D. Debugging
5. The term “trace” in algorithms means:
A. Running a program on a computer
B. Manually stepping through instructions
C. Converting code into machine language
D. Printing results
6. A flowchart is used to:
A. Defragment memory
B. Represent an algorithm visually
C. Replace pseudocode
D. Compile a program
7. The purpose of analyzing an algorithm is to:
A. Determine correctness and efficiency
B. Convert it to binary
C. Draw flowcharts
D. Create animations
8. Which is an example of an algorithm’s input?
A. Final printed report
B. The information supplied before execution
C. The executed output
D. A flowchart symbol
9. The final step of algorithm development is:
A. Debugging
B. Documentation
C. Testing
D. Implementation
10. Which of the following is not a characteristic of a good algorithm?
A. Efficiency
B. Clarity
C. Ambiguity
D. Termination
B. Operators (10 MCQs)
11. The operator += is classified as:
A. Logical operator
B. Compound assignment operator
C. Relational operator
D. Increment operator
12. Which operator returns true when both conditions are true?
A. OR
B. AND
C. NOT
D. XOR
13. The expression 5 > 2 is a:
A. Logical expression
B. Arithmetic expression
C. Relational expression
D. Assignment expression
14. Which of the following is an arithmetic operator?
A. &&
B. ==
C. /
D. !=
15. Which operator is used to compare two values?
A. =
B. ==
C. :=
D. +=
16. In the expression x = x + 1, the operator + is:
A. Logical
B. Arithmetic
C. Assignment
D. Bitwise
17. The operator !== means:
A. Greater than
B. Equal to
C. Not equal to
D. Less than
18. Which expression uses a logical NOT?
A. A && B
B. !A
C. A || B
D. A ** B
19. The purpose of assignment operators is to:
A. Determine truth values
B. Add two numbers
C. Update variable values
D. Compare variables
20. The operator /= means:
A. Multiply and assign
B. Divide and assign
C. Subtract and assign
D. Compare and divide
C. Sequence Structure (10 MCQs)
21. Sequence structure means instructions are executed:
A. Randomly
B. Based on conditions
C. One after another
D. Only when true
22. Which of the following is not part of a sequence structure?
A. Input
B. Process
C. Output
D. Decision-making
23. The flowchart symbol used for input/output is a:
A. Diamond
B. Oval
C. Parallelogram
D. Rectangle
24. The flowchart symbol representing a process is a:
A. Parallelogram
B. Rectangle
C. Diamond
D. Circle
25. In a sequence, the order of statements:
A. Does not matter
B. Must follow a specific order
C. Is determined at runtime
D. Uses decision boxes
26. A pseudocode example of a sequence is:
A. IF age > 18 THEN
B. WHILE number < 10
C. Read X; Compute Y; Print Z
D. SWITCH(option)
27. In sequence structure, looping occurs:
A. Always
B. Never
C. Only if condition is true
D. Before input
28. A sequence algorithm must:
A. Include IF statements
B. Have at least one loop
C. Execute all steps in order
D. Skip steps when necessary
29. Which statement is true about sequence?
A. Executes steps unconditionally
B. Depends on decisions
C. Repeats until false
D. Requires a switch statement
30. The start/end of a sequence in a flowchart is shown by a:
A. Diamond
B. Parallelogram
C. Rectangle
D. Oval
D. IF–THEN–ELSE (10 MCQs)
31. The decision symbol (diamond) in a flowchart represents:
A. Input
B. Output
C. Selection
D. Processing
32. IF–THEN–ELSE structure is used for:
A. Repetition
B. Sequencing
C. Branching
D. Termination
33. The ELSE part of an IF statement executes when:
A. The IF condition is true
B. The IF condition is false
C. The program ends
D. A loop finishes
34. Which is the correct pseudocode?
A. IF a > b THEN print a
B. IF a > b print a END
C. IF a > b ELSE print a
D. a > b THEN print a
35. Which flowchart symbol is used after evaluating a condition?
A. Oval
B. Rectangle
C. Diamond
D. Arrow
36. Nested IF means:
A. Two IFs side by side
B. One IF inside another
C. IF written backwards
D. IF without ELSE
37. A simple IF statement has how many possible paths?
A. Zero
B. One
C. Two
D. Three
38. The logical operator often used in IF conditions:
A. +
B. -
C. &&
D. :=
39. IF temperature > 100 THEN print “Hot” is an example of:
A. Looping
B. Assignment
C. Comparison
D. Recursion
[Link] must always be paired with:
A. LOOP
B. START
C. IF
D. SWITCH
E. Switch Statement (10 MCQs)
41. A switch statement is used to:
A. Perform looping
B. Select one option from many
C. Add two numbers
D. Exit a program
42. In a switch structure, each possible option is called a:
A. Case
B. Condition
C. Loop
D. Brancher
43. The default case in a switch:
A. Executes only when a match is found
B. Executes when no case matches
C. Is optional but must be first
D. Ends the program
44. Switch statements are best used when:
A. Many repeating conditions exist
B. Two comparisons are needed
C. No conditions exist
D. Loops are required
45. Which flowchart symbol represents multiple branching?
A. Parallelogram
B. Diamond
C. Oval
D. Rectangle
46. The value inside SWITCH is usually a:
A. Condition
B. Variable or expression
C. Loop counter
D. Boolean
47. In pseudocode, a case label is usually written as:
A. CASE value:
B. IF value THEN
C. WHEN value DO
D. LOOP value
48. SWITCH statements are an alternative to:
A. Nested IF–ELSE
B. While loops
C. Functions
D. Input operations
49. A switch statement requires:
A. Only one possible path
B. At least one case
C. No input
D. A loop
50. The break statement in a switch is used to:
A. Jump to the top
B. Prevent fall-through
C. Terminate the program
D. Reset variables
PSEUDOCODE EXAM QUESTIONS
1. Write a pseudocode and draw a flowchart for an algorithm that reads two numbers, adds
them, and displays the sum using sequence structure.
2. Develop a pseudocode using IF–THEN–ELSE that determines whether a student passed
or failed based on a score of 50. Include a flowchart.
3. Write a pseudocode that uses compound assignment operators (+=, -=, *=) to update a
running total.
4. Create a pseudocode for a SWITCH structure that prints the day of the week based on
user input (1–7).
5. Given three numbers, write a pseudocode using nested IF–ELSE to identify the largest
number.
6. Write a pseudocode algorithm that calculates a customer’s discount rate based on
purchase amount using IF–THEN–ELSE selection statements.
7. Design a pseudocode that reads a temperature and uses IF–THEN–ELSE to categorize it
as “Cold”, “Warm”, or “Hot”. Draw the corresponding flowchart.
FLOWCHART
1. Area of a Triangle
Problem:
Write a pseudocode that reads the base and height of a triangle, calculates its area using the
formula:
Area = (base * height) / 2
Display the area.
Then draw a flowchart based on your pseudocode.
2. Check if a Number is Even or Odd
Problem:
Write pseudocode using IF–THEN–ELSE to determine if a number entered by the user is even
or odd.
If number % 2 = 0 → display “Even”
Else → display “Odd”
Draw the flowchart showing the decision structure.
3. Simple Calculator Using SWITCH
Problem:
Write pseudocode for a calculator that asks the user for two numbers and an operator (+, −, *, /).
Use a SWITCH structure to perform the correct operation.
Display the result.
Draw the flowchart showing multiple branching.
4. Student Grade Classification
Problem:
Write pseudocode that reads a student’s score and classifies it as:
90–100: “Excellent”
75–89: “Good”
50–74: “Average”
Below 50: “Fail”
Use nested IF–THEN–ELSE.
Draw the matching flowchart.
5. Total Price with Tax
Problem:
Write pseudocode that:
1. Reads the item price
2. Reads the tax rate
3. Computes:
4. tax = price * taxRate
5. total = price + tax
6. Displays the total price.
Draw a sequence-structure flowchart (no decisions).
6. Determine the Largest of Three Numbers
Problem:
Write pseudocode that reads three numbers and determines the largest using nested IF
conditions.
Then draw the flowchart for the comparison process.
7. Temperature Category
Problem :
Write pseudocode that:
Reads a temperature value
If temperature < 20 → “Cold”
If 20–30 → “Warm”
If > 30 → “Hot”
Use IF–THEN–ELSE.
Draw the corresponding flowchart.
If you want, I can also create:
✔ The actual flowcharts for each problem
✔ Printable worksheet version
✔ Additional pseudocode problems (10, 20, or 50+)
8. Compute Simple Interest
Problem:
Write pseudocode to compute the simple interest using:
Interest = (Principal * Rate * Time) / 100
Read Principal, Rate, and Time, then display the Interest.
Draw the flowchart.
9. Check if a Number is Positive, Negative, or Zero
Problem:
Write pseudocode using IF–ELSE IF–ELSE to determine if a user-entered number is:
Positive
Negative
Zero
Draw a decision flowchart based on your pseudocode.
10. Convert Celsius to Fahrenheit
Problem:
Write pseudocode that reads a temperature in Celsius and converts it using:
F = (C * 9/5) + 32
Display the Fahrenheit temperature.
Draw the flowchart (sequence only).
11. Determine if a Person is Eligible to Vote
Problem:
Write pseudocode that reads a person’s age.
If age ≥ 18 → “Eligible to Vote”
Else → “Not Eligible to Vote”
Draw a flowchart showing the decision-making process.
12. Classify a Number as Small, Medium, or Large
Problem:
Write pseudocode that reads a number and classifies it as:
Less than 10 → “Small”
Between 10 and 50 → “Medium”
Greater than 50 → “Large”
Draw the flowchart with multiple decision branches.
13. Determine Discount Based on Membership
Problem:
Write pseudocode that reads:
Purchase amount
Membership type (Gold, Silver, Regular)
Apply discounts:
Gold → 20%
Silver → 10%
Regular → 5%
Use a SWITCH structure.
Draw the flowchart showing multiple cases.