Note AcademyNote Academy

Computer Science · Oct / Nov 2022 · Paper 1 HL · Question 13

IBCS

As printed in the paper

The question as text

13. A list of students’ names and test scores are written in a teacher’s notebook in alphabetical order. The teacher uses an application that allows her to input all of the names and scores in the order they appear in her notebook. The application orders the scores from highest to lowest and then outputs all the names and scores (see Figure 1). Figure 1: An example of the input and output of the application Input: Anna 56 Ava 47 Baker 24 Emma 87 Nolan 63 Zara 90 Output: Zara 90 Emma 87 Nolan 63 Anna 56 Ava 47 Baker 24 The application: y inputs the names and scores y stores the input data in two arrays: NAMES and SCORES (see Figure 2) Figure 2: The NAMES and SCORES arrays NAMES Anna Ava Baker Emma Nolan Zara [0] [1] [2] [3] [4] [5] SCORES 56 47 24 87 63 90 For example, NAMES[3] holds the student’s name (Emma), and her score (87) can be found in SCORES[3]. The application also: y sorts the input data in order of scores from the highest to the lowest by using a bubble sort algorithm. y outputs the sorted data.

Read automatically from the paper; the printed page above is exact.

Show the answer and mark scheme
  • 13(a)(i)[5]

  • 13(a)(ii)[1]

  • 13(b)[3]

  • 13(c)[6]

Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.