Question 7
OCR Computer Science Specimen Paper 1AS14 marks
On the specification
- (a)
- 1.3 Exchanging data
- (b)(i)
- 1.3 Exchanging data
- (b)(ii)
- 1.2 Software and software development
- (c)
- 2.2 Problem solving and programming1.4 Data types, data structures and algorithms
Question text
7 Laser Tag is a game where teams of players move round an arena shooting each other with infrared guns. Players wear sensors that keep track of how many times they have been hit by the laser. This is known as being ‘tagged’. Below is an extract from a Laser Tag company’s website: Reasons to Choose Us Come play Laser Tag with us for: • State of the art equipment • Friendly staff • Match recordings available to purchase • Buy two games get one free. The web page is written in HTML. (a) Write some HTML code which could have been used to produce this extract. You can assume it is already inside <body> tags. [4] (b) The website also includes JavaScript. (i) Describe what is meant by the term JavaScript. [2] (ii) Explain why it is usually the case that JavaScript is interpreted rather than compiled. [2] (c) At the end of each match players upload their score to a computer. The computer stores the scores in the order they are received in a 2D array called player. The array stores the team as an integer (1 for green, 2 for red) and their score. An extract of the array called player is shown below. The first entry shows a green team member scored 45 points and the next shows a red team member scored 30 points. 1 45 2 30 2 46 1 31 1 10 1 32 22 Once all the players have uploaded their scores the computer adds up the scores for each team. Using pseudocode write a program for a procedural language that works out and outputs the total score for each team. You may assume that there are always 20 players. [6]