Question 7

AQA Computer Science Specimen Paper 1 (7517/1)A level12 marks

On the specification

7.1
4.1 Fundamentals of programming
7.2
4.1 Fundamentals of programming
7.3
3.2 Fundamentals of data structures
7.4
4.1 Fundamentals of programming
7.5
3.1 Fundamentals of programming
7.6
4.1 Fundamentals of programming
7.7
3.1 Fundamentals of programming
7.8
3.1 Fundamentals of programming
7.9
4.1 Fundamentals of programming3.2 Fundamentals of data structures
Question text

7 The class diagram in Figure 8 is an attempt to represent the relationships between some of the classes in the MONSTER! Game. Figure 8 Item #NoOfCellsEast : Integer #NoOfCellsSouth : Integer +GetPosition() +SetPosition(Position) +CheckIfSameCell(Position) Trap Monster Character -Triggered : Boolean -Awake : Boolean +MakeMove(Direction) +GetTriggered() +MakeMove(PlayerPosition) +ToggleTrap() +GetAwake() +ChangeSleepStatus() 7.1 Explain what errors have been made in Figure 8. [2 marks] 7.2 Give an example of instantiation from the Skeleton Program. [1 mark] 7.3 State the name of an identifier for an array variable. [1 mark] 7.4 State the name of an identifier for a subclass. [1 mark] 7.5 State the name of an identifier for a variable that is used to store a whole number. [1 mark] 7.6 State the name of an identifier for a class that uses composition. [1 mark] Look at the GetNewRandomPosition subroutine in the Game class in the Skeleton Program. 7.7 Explain why the generation of a random position needs to be inside a repetition structure. [1 mark] 7.8 Look at the Game class in the Skeleton Program. Why has a named constant been used instead of a numeric value? [2 marks] 7.9 Describe the changes that would need to be made to the Game class to add a third trap to the cavern. The third trap should have exactly the same functionality as the other two traps. You do not need to describe the changes that would need to be made to the SetUpGame subroutine. [2 marks] END OF SECTION C You are advised to spend no more than 60 minutes on this section. Type your answers to Section D in your Electronic Answer Document. You must save this document at regular intervals. These questions require you to load the Skeleton Program and to make programming changes to it.