# A-level Computing 2009/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2012 Exam/Section C

## Validation

 Error Checking List the Erroneous, Extreme and Typical Data for a user selecting a menu item: Answer: Typical = 3 Extreme = 9,4 or 1 Erroneous = 7 List the Erroneous, Extreme and Typical Data for direction input: Answer: Typical = N,S,E or W Extreme = N,S,E or W Erroneous = I

## Variables

 Loops Give the name of a stepper variable used in a loop? Answer: Count1, Count2, Count Give the name of a fixed variable used in a loop? Answer: NSDistance, WEDistance Give the name of a follower used in a loop? Answer: Give the name of a most recent holder used in a loop? Answer: Choice MAY be an answer here. FlaskPosition may be a recent holder(?). See 'MoveFlask()' sub-routine. I think it is because the program holds the flask ("F") in the 'FlaskPosition' cell reference until the 'NewCellForFlask' variable can hold "F" (after which FlaskPosition changes to " "): ``` Sub MoveFlask(ByRef Cavern(,) As Char, ByVal NewCellForFlask As CellReference, ByRef FlaskPosition As CellReference) Cavern(NewCellForFlask.NoOfCellsSouth, NewCellForFlask.NoOfCellsEast) = "F" Cavern(FlaskPosition.NoOfCellsSouth, FlaskPosition.NoOfCellsEast) = " " FlaskPosition = NewCellForFlask End Sub ``` What is the purpose of nested loops? Answer: To check each element of the array by progressing firstly along the columns, then down to the next row and to continue until the end of the array is reached; Why have they used FOR loops in the subroutine ResetCavern? Answer: The loop end is known when the loop is created and therefore has a known number of steps; the loop does not depend upon an event where the occurrence of that event is unknown;Template:CBTAnswerTabEnd