Look up one field
Level 1: Records. A typical Paper 2 task is an array of records plus a search for one field, instead of two parallel arrays.
The array is already filled. Read a name. Output that student's mark, or Not found if the name is not there.
Example: input Ada → 80. Input Zed → Not found.
Plan it in three steps:
- Set a flag
Found <- FALSEbefore the loop. - Inside the
FORloop,IFthe name matches:OUTPUTthe mark and setFound <- TRUE. NoELSEhere — it would print "Not found" for every non-match. - After
NEXT,IF Found = FALSEthenOUTPUT "Not found".