Validation Exercises

1. Develop a program to read a map reference consisting of a single alpha chracter and a number. Valid map references are A-G and 1-15.

a). Validate the input and generate a message saying whether the map reference is valid or not.
[Specimen answer]

 

b). Validate the input at source and only allow valid map references to be entered.
[Specimen answer]