Question 7
OCR Computer Science June 2016 Paper 2AS4 marks
On the specification
- (a)
- 2.2 Problem solving and programming1.4 Data types, data structures and algorithms
- (b)
- 2.2 Problem solving and programming1.4 Data types, data structures and algorithms
- (c)
- 2.2 Problem solving and programming1.4 Data types, data structures and algorithms
- (d)
- 2.2 Problem solving and programming1.4 Data types, data structures and algorithms
Question text
7 Given the following pseudocode: d = 5 if ((a > b) OR (b >= c)) then if ((c < a ) XOR (c < b)) then // Check to see if one or the other // comparisons are TRUE, but not both d = 15 else d = 16 endif else d = 14 endif print(d) (a) State the value of d if a=42, b=41 and c=42 (b) State the value of d if a=42, b=36 and c=4 (c) State the value of d if a=42, b=36 and c=36 (d) Give one potential value of b if the output value of a=42, c=44 and d=14. [4]