Writing your answer
Once youâve thought about how youâll meet each individual requirement, you need to write the answer in pseudocode Also written as pseudo-code. A method of writing up a set of instructions for a computer program using plain English. This is a good way of planning a program before coding.. Remember, you can add comments to pseudo-code by putting a # at the start of the comment. Comments in pseudo-code questions enable you to explain things that arenât obvious to the examiner.
SET looping TO TRUEÂ Â Â Â Â #used to keep the loop running until the user wants to quit
WHILE looping = TRUE DOÂ Â Â Â Â #loop to keep asking for identifiers
     #get identifier from user
     RECEIVE identifier FROM (STRING) KEYBOARD
     IF identifier = âQâ THEN     #user wants to quit
          SET looping TO FALSE     #loop wonât run again as condition will be false
          SEND âByeâ TO DISPLAY
ÌęÌęÌęÌęÌę·Ąłął§·Ą IF LENGTH (identifier) <> 9 THEN
          SEND âThe customer identifier is not nine characters longâ TO DISPLAY
ÌęÌęÌęÌęÌę·Ąłął§·Ą
          #check last 3 characters
          SET badAlpha TO FALSE #this is a flag that will be changed to TRUE if a non-uppercase letter is found
          FOR count FROM 6 TO 8 DO
               IF (NOT (identifier[count] >= âAâ AND identifier[count] <= âZâ)) THEN
               SEND âBad character in last 3 characters foundâ TO DISPLAY
               SET badAlpha TO TRUE
          END IF
     END FOR
     IF badAlpha = FALSE THEN
          SEND âFinal three characters are validâ TO DISPLAY
     END IF
END IF
It is important to use easy-to-understand identifierA name given to a part of a program, such as a variable, constant, function, procedure or module. names and use indentation correctly as this will make the pseudo-code easier to read and help you gain maximum marks.