The following questions are provided in PDF here:
with answer lines |
without answer lines
An
Electronic Answer Document (EAD) is provided for all questions/tasks.
Save this file to an accessible location before you start.
- State the name of an identifier for:
- A local variable in the function RollDie [1]
- A function that returns multiple variables [1]
- Four built-in functions used in the function TakeItemFromOtherCharacter [4]
- A class that has exactly four attributes [1]
- A constructor [1]
- A variable used as a constant [1]
- Two user-defined functions with four parameters [2]
- A user-defined function, other than Main, that takes no arguments [1]
|
- Explain the purpose of the following line in the GetInstruction subroutine: [2]
|
- Explain the role of the variable Moved in the function Go. [3]
|
- Explain the purpose of the command break used in the function GetResultForCommand. [2]
|
- Using any example from the skeleton program, describe what it meant by the term string concatenation. [2]
|
- Describe in detail the role of the procedure DisplayInventory. [5]
|
- Describe the role of the variable TempCharacter in the function LoadGame. [3]
|
- Explain why LowerLimitValue in the function RollDie is initialised to zero. [3]
|
- Explain the purpose of each of the two while loops in the function ExtractCommand. [5]
|
- Describe the purpose of the first for loop in the function CheckIfDiceGamePossible. [4]
|
- Describe the changes that would need to be made so that the game would output the text 'You are carrying nothing' if the player attempts to examine an empty inventory. [4]
|
- Describe the changes that would need to be made to the function GetInstruction to ensure that a string of two or more characters has been entered before GetInstruction returns that string. [3]
|
- Describe the effect of a file not being found during the function LoadGame. [2]
|