IF ... THEN ... ELSE ... ENDIF and CASE ... OF ... OTHERWISE ... ENDCASE are two different conditional statements that you can use when writing pseudocode. Explain, using examples, why you would choose to use each conditional statement. Example 1 Reason for choice Example 2 Reason for choice
- (a) IF...THEN...ELSE...ENDIFExplain, using examples, why you would choose to use each conditional statement. Example 1 Reason for choice[3]
- (b) CASE...OF...OTHERWISE...ENDCASEExample 2 Reason for choice[3]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2016). The mark or mark type is shown in brackets.
- [6] For each example: 1 mark for correct structure, 1 mark for appropriate content, 1 mark for the reason. There are many correct answers these are only examples
- IF X > 0 AND X <= 10 THEN PRINT 'In Range' ELSE PRINT 'Out of Range' ENDIF
- - e.g. checking a condition that may be complex//uses relational operators// checking for a range of values// only 2 options
- CASE X OF 1 : PRINT 'Option 1' 2 : PRINT 'Option 2' 3 : PRINT 'Option 3' OTHERWISE PRINT 'Incorrect choice' ENDCASE
- - e.g. checking for discrete/large number/more than 2 of values
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →