Skip to content

b. Test Your Knowledge

Activity A - Multiple-Choice Review (1 mark each)

(Recall-style, Section A format)

1. Which control structure runs line by line in order?

A. Selection

B. Iteration

C. Sequence

D. Validation

Answer

C. Sequence


2. Which control structure is best when a program needs to repeat until valid input is entered?

A. Sequence

B. Selection

C. Iteration

D. Assignment

Answer

C. Iteration


3. Which loop always runs at least once?

A. FOR

B. WHILE

C. DO/WHILE

D. None of them

Answer

C. DO/WHILE


4. Which validation technique checks whether a required field has been left blank?

A. Type checking

B. Existence checking

C. Range checking

D. Arithmetic checking

Answer

B. Existence checking


5. Why are separate IF statements sometimes less suitable than a chained ELSEIF structure?

A. They cannot test Boolean conditions

B. They force the program to stop immediately

C. More than one branch may run when only one should

D. They cannot be used with input

Answer

C. More than one branch may run when only one should


Activity B - Short Answer Practice (2-4 marks each)

(Section B format - active recall)

1. Explain one difference between a WHILE loop and a FOR loop.


2. Describe one situation where a chained selection is more suitable than a single IF statement.


3. Explain why validation does not prove that data is true in the real world.


4. State the sensible order for performing existence, type and range checks, and explain why that order matters.


5. Describe one problem caused by an infinite loop.


6. Explain one reason why truth tables can help with complex conditions.


Activity C - Scenario Application (3-6 marks each)

(Section C style - applied retrieval)

Scenario 1 - Menu selection

A program asks the user to choose:

  • 1 for add
  • 2 for edit
  • 3 for delete

Tasks:

  1. Identify the most suitable control structure for handling these options.
  2. Explain why that structure is suitable.
  3. State one validation rule the program should apply to the user input.

Scenario 2 - Age checker

A form asks a user to enter their age. The age must:

  • not be blank
  • be numeric
  • be between 15 and 17 inclusive

Tasks:

  1. Name the three validation techniques involved.
  2. State the best order to apply them.
  3. Explain why that order is sensible.

Activity D - Extended Response (6-8 marks)

(Analytical / evaluation task)

Prompt:

Discuss how control structures and validation work together to make a program behave correctly.

In your response, refer to:

  • at least one type of selection or iteration
  • at least two validation techniques
  • one example of a possible logic error or invalid input problem