Presentation is loading. Please wait.

Presentation is loading. Please wait.

2015 Pre-Release Practice Click the button to try a random exam-style question. Click on the reveal button to check your answer.

Similar presentations


Presentation on theme: "2015 Pre-Release Practice Click the button to try a random exam-style question. Click on the reveal button to check your answer."— Presentation transcript:

1 2015 Pre-Release Practice Click the button to try a random exam-style question. Click on the reveal button to check your answer.

2 Identify a user defined sub-routine with one parameter WhoseTurn is the only parameter passed in here.

3 Identify a user defined sub-routine with a Boolean Output The function will return a true or false value. If a piece will land on a Sarrum, then the game is won

4 Identify a variable that is used to control the iteration of a loop In this instance, Count is used to control the FOR loop. This is seen in the CheckGisgigirMoveIsLegal Function In this instance, Count is used to control the FOR loop. This is seen in the CheckGisgigirMoveIsLegal Function

5 Identify an array variable TBoard is an example of an array variable. Board is then a variable of type Tboard.

6 Identify a constant BoardDimension is a constant. It’s value will never be changed throughout the program.

7 Identify an item with a fixed-value role BoardDimension is a constant. It’s value will never be changed throughout the program.

8 Why has a constant been used for BoardDimension instead of just typing the number 8? BoardDimension is a constant. It’s value will never be changed throughout the program. By setting a constant, the value only needs to be assigned once. This can then be called by value multiple times through the program. Eg. Right now, BoardDimension is currently set to 8, but if we want to change that to 9, we only need to change one line of code to affect the whole program and the size of the board. By setting a constant, the value only needs to be assigned once. This can then be called by value multiple times through the program. Eg. Right now, BoardDimension is currently set to 8, but if we want to change that to 9, we only need to change one line of code to affect the whole program and the size of the board.

9 Under what circumstances will the For Loop stop? BoardDimension is set to 8 The for loop will run until RankNo equals 8 When this condition is met, the loop will end. BoardDimension is set to 8 The for loop will run until RankNo equals 8 When this condition is met, the loop will end.

10 State the name of a variable that has a stepper role. RankNo is an example of a stepper variable as it starts at 1 and increments by one for every loop that the program performs.

11 Give an example of an assignment statement in this subroutine. CheckNabuMoveIsLegal := False is an example of assignment in this procedure. The value of False is assigned to the Return value of the function. CheckNabuMoveIsLegal := False is an example of assignment in this procedure. The value of False is assigned to the Return value of the function.

12 State two reasons why sub-routines should not use global variables 1. Any changes made to the variable will take place across the whole program 2. Local variables only take up memory when the sub-routine is in use 3. Global variables make a program difficult to debug (find errors)

13 Explain what is meant by a boundary value. Boundary values are those values which are just on or inside the minimum or maximum values allowed within a statement.

14 Identify a user defined sub-routine that only produces output to the screen DisplayWhoseTurnItIs is a procedure which includes a number of writeln statements, but performs no other tasks. There are several other procedures which also do this. DisplayWhoseTurnItIs is a procedure which includes a number of writeln statements, but performs no other tasks. There are several other procedures which also do this.

15 Name the parameters of the function. The parameters used in this function are Board, StartRank,StartFile, FinishRank, and FinishFile. These are the values which are passed into the function from the CheckMoveIsLegal Function. The parameters used in this function are Board, StartRank,StartFile, FinishRank, and FinishFile. These are the values which are passed into the function from the CheckMoveIsLegal Function.

16 What is the benefit of using a Case statement here? There are a finite number of options available. By using a case the program will identify which statement to run and then break out of the code. This is more efficient than a long IF, ELSE IF statement


Download ppt "2015 Pre-Release Practice Click the button to try a random exam-style question. Click on the reveal button to check your answer."

Similar presentations


Ads by Google