Download as pdf or txt
Download as pdf or txt
You are on page 1of 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