Untitled

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Q1.

a) Line 1, Line 3 to Line 14, Line 12, Line 19 to Line 22

b) Error 1 - Line 2

Correction – TooCold ←0

Error 2 – Line 8

Correction – TooCold ← TooCold + 1

Error 3 – Line 15

Correction – IF TooHot > 5

Error 4 – Line 17

Correction – OUTPUT “Alarm!”

c) We would make a new assignment and assign 0 as the value to it, this would be the counter for
seeing if the temperature is in the range. We could then use an IF Statement/range check to see if
the input is within the range of -18 and -25 and then use counting to keep track of every time its
within the range.

Q2. A) IF Number = 20 , PRINT Number

Number ← Number + 1

b) IF Number = 20 – Selection Statement

PRINT Number – Output

Number ← Number + 1 – Counting

Q3.

1 2

2 5

3 1

4 4

You might also like