Programming is writing instructions that a computer can carry out. This topic covers the building blocks found in every language. Variables and constants store data of a type such as integer, real, string or Boolean. Sequence, selection and iteration control the order of steps: IF statements choose, and FOR, WHILE and REPEAT loops repeat. Arrays hold lists of values, and procedures and functions break a long program into parts. Programs also validate input, handle strings and read and write files. You practise these in pseudocode and in Python.
27. What is output?27 < 5 is FALSE, so the ELSE branch runs. Inside it, 27 > 25 is TRUE, so Hot is output. The OUTPUT Checked is also inside the ELSE branch, after the inner ENDIF, so it runs too.
Hot only forgets the line after the inner ENDIF. Checked only misses the inner IF. Cold needs a value below 5.Log in to join the discussion.
Loading…