Past-paper question · 2015 October-November · Paper 22 · Q1(g)(i)

Question 1(g)(i) 2015 · October-November · Paper 22 · 6 marks

Original past-paper question for 1(G)(I)
Original past-paper question for 1(G)(I)
Original past-paper question for 1(G)(I)
Original past-paper question for 1(G)(I)
Original past-paper question for 1(G)(I)
Reveal official mark-scheme answer Official mark-scheme answer for 1(G)(I)

Official answer for Question 1

Part (g)

(i)

Part (g)

(i)

Mark as follows:

  • initial value of TopRatingSoFar (outside loop)
  • loop
  • compare rating
  • update rating if appropriate
  • keep note of title/array index
  • output top title only
  • correct field notation
✓
Example pseudocode:
✓
TopRatingSoFar 0
✓
i 0
✓
REPEAT
✓
i i + 1
✓
IF TopRatingSoFar < Book[i].Rating
✓
THEN
✓
TopRatingSoFar Book[i].Rating
✓
TopBookTitle Book[i].Title
✓
ENDIF
✓
UNTIL Book[i].Title = ""
✓
OUTPUT TopBookTitle
✓
Alternative answer:
✓
TopRatingSoFar 0
✓
FOR i TO 100
✓
IF TopRatingSoFar < Book[i].Rating
✓
THEN
✓
TopRatingSoFar Book[i].Rating
✓
TopBookTitle Book[i].Title
✓
ENDIF
✓
ENDFOR
✓
OUTPUT TopBookTitle
✓
[max 6]

Mark scheme 9691_w15_ms_22.pdf →

Show text version of question

Question 1

Part (g)

(i)

Sheena wants to know the title of her favourite book. She plans to write code to search the array Book.

(i)

Write pseudocode to output the title of the book with the highest rating. For now, assume

that only one book in the Book array has the highest rating.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

.......................................................................................................................................[6]

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9691_w15_qp_22.pdf

Keep practising this topic