0% found this document useful (0 votes)
125 views2 pages

I Focus: Test Your Knowledge

This document provides 4 short programming problems to test knowledge of selection statements. For each problem: 1) The problem is described and the number of marks allocated is stated 2) A possible pseudocode solution is provided using IF/ELSE selection statements The problems involve: checking time for lunch, displaying inside message based on weather, grading a quiz mark as pass/fail, and finding the largest of 3 unequal input values. The total marks for all problems is 20.

Uploaded by

Chad Mcdonald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views2 pages

I Focus: Test Your Knowledge

This document provides 4 short programming problems to test knowledge of selection statements. For each problem: 1) The problem is described and the number of marks allocated is stated 2) A possible pseudocode solution is provided using IF/ELSE selection statements The problems involve: checking time for lunch, displaying inside message based on weather, grading a quiz mark as pass/fail, and finding the largest of 3 unequal input values. The total marks for all problems is 20.

Uploaded by

Chad Mcdonald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Information Technology in FOCUS for CSEC

SECTION 2 OF SYLLABUS: CHAPTER 30: Problem Solving and Programming – Selection Statement

Activity # 30 - b

TEST YOUR KNOWLEDGE


Chapter 30: Problem Solving and Programming – Selection Statement

Examination based short answer questions


INSTRUCTION: Answer all questions using the appropriate selection statements.

1. Write an algorithm in Pseudocode that will read the time. If the time is 12:00 then output
“Lunch Time”. (5 marks)

Possible Solution:

Start
Write “Enter time of day”
Read TIME
IF TIME 12:00 THEN
Write “Lunch Time”
ENDIF
Stop

2. Read the weather condition; if the weather is Rainy, display “Stay Inside”. (5 marks)

Possible Solution:

Start
Write “Enter weather condition”
Read weather_cond
IF weather_cond RAINY THEN
Write “Stay Inside”
ENDIF
Stop

1
Information Technology in FOCUS for CSEC
SECTION 2 OF SYLLABUS: CHAPTER 30: Problem Solving and Programming – Selection Statement

3. Write an algorithm to prompt the user to input the mark a student received in a quiz. If the
student’s mark is more than 70, print “Pass” otherwise print “Fail”. (5 marks)

Possible Solution:

Start
Write “Enter a student mark”
Read STUDENT_MARK
IF STUDENT_MARK > 70 THEN
Write “Pass”
ELSE
Write “Fail”
ENDIF
Stop

4. Write an algorithm that will prompt the user to enter three unequal values, and output the
largest among them. (5 marks)

Possible Solution:

Start
Write “Enter three unequal values”
Read X, Y, Z
IF X > Y THEN
Set LARGE  X
ELSE
Set LARGE  Y
IF Z > LARGE THEN
Set LARGE  Z
ENDIF
ENDIF
Write “The Largest would be: ” , LARGE
Stop

TOTAL 20 MARKS

You might also like