Six original Cambridge-style questions on arithmetic, relational and logical operators, with mark points.
Name the three types of operator used in pseudocode and give one example of each.
Evaluate: (a) 4 + 6 / 2 (b) (4 + 6) / 2 (c) 3 ^ 2 * 2
X is 7 and Y is 12. State whether each condition is TRUE or FALSE: (a) X > 5 AND Y < 10 (b) X > 5 OR Y < 10 (c) NOT (X = Y)
Write pseudocode that inputs an exam mark and outputs "Valid" if it is from 0 to 100 inclusive, or "Invalid" otherwise.
INPUT Mark ✓IF Mark >= 0 AND Mark <= 100 ✓THEN OUTPUT "Valid" ELSE OUTPUT "Invalid" with ENDIF ✓A zoo lets in children under 5 and adults over 80 free. Write an IF statement that outputs "Free" or "Pay" for the variable Age.
IF Age < 5 OR Age > 80 ✓THEN OUTPUT "Free" ✓ELSE OUTPUT "Pay" and ENDIF ✓A student writes IF Mark > 40 AND < 60 to test for marks from 41 to 59. Explain the error and correct it.
IF Mark > 40 AND Mark < 60. ✓Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.