Photo AI

The diving competitions at the gala will be scored by five judges - Edexcel - GCSE Computer Science - Question 9 - 2021 - Paper 1

Question icon

Question 9

The-diving-competitions-at-the-gala-will-be-scored-by-five-judges-Edexcel-GCSE Computer Science-Question 9-2021-Paper 1.png

The diving competitions at the gala will be scored by five judges. Each judge awards each dive a score between 0.0 and 10.0. The highest and lowest of the judges' sc... show full transcript

Worked Solution & Example Answer:The diving competitions at the gala will be scored by five judges - Edexcel - GCSE Computer Science - Question 9 - 2021 - Paper 1

Step 1

ARRAY scores

96%

114 rated

Answer

Define an array scores with the given values:

ARRAY scores
SET scores TO [8.9, 9.1, 8.2, 7.8, 8.1]

Step 2

REAL inFactor

99%

104 rated

Answer

Declare a variable inFactor to hold the degree of difficulty factor:

REAL inFactor

Step 3

Find highest and lowest scores

96%

101 rated

Answer

Initialize variables to hold the highest and lowest scores:

REAL highest = 10.0
REAL lowest = 0.0

Step 4

Loop through scores

98%

120 rated

Answer

Use a loop to find the highest and lowest scores:

FOR index FROM 1 TO LENGTH(scores) DO
  IF scores[index] < lowest THEN
    lowest = scores[index]
  END IF
  IF scores[index] > highest THEN
    highest = scores[index]
  END IF
END FOR

Step 5

Calculate total score

97%

117 rated

Answer

Compute the total of the remaining scores:

REAL total = 0
FOR index FROM 1 TO LENGTH(scores) DO
  IF scores[index] != highest AND scores[index] != lowest THEN
    total = total + scores[index]
  END IF
END FOR

Step 6

Calculate dive score

97%

121 rated

Answer

Calculate the final dive score:

REAL diveScore = total * inFactor
DISPLAY diveScore

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;