ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions

Higher Computing Science 2019 Question 15

7 marks · Data types and structures

The data will be stored in parallel 1D arrays. Using a programming language of your choice, declare parallel 1D arrays that can store the data for the 200 competitors. Different options are selected by clicking on a button as shown below. Orienteering qualifiers Please select from the buttons below: Count the number of Count the number of Junior qualifiers Senior qualifiers When the ‘Count the number of Junior qualifiers’ option is selected, the user is asked to enter the qualifying score. The program will then count how many Juniors achieved at least that score. An example output is shown below. ‘12 Juniors achieved the qualifying score of 42’ Using a programming language of your choice, write the code to ask for a qualifying score and then output the appropriate message. Two hundred competitors entered a regional orienteering competition in either the Junior or Senior category. Each competitor received a score based on their performance. The names, categories and scores are stored in a csv file called ‘competitors.csv’. Part of the file is shown below. Senga Jones,Senior,67 Agnes Adam,Junior,88 … A program is required to read the data from the csv file and then offer a menu of different options.

Marking scheme

• Three arrays of 200 elements • Data types of each array: string, string, integer 1 mark for each bullet • initialise and increment count • loop with termination • condition matching category • condition matching score >= qualScore • output statement concatenating count, message and qualScore 1 mark for each bullet DECLARE count INITIALLY O RECEIVE qualScore FROM KEYBOARD FOR index FROM 0 to 199 DO If category[index] =“Junior” AND score[index]>= qualScore THEN SET count to count +1 END IF NEXT FOR SEND count & “Juniors achieved the qualifying score of ”& qualScore Concatenation can be &, +, comma

Previous question: Higher Computing Science 2019 Question 14

Next question: Higher Computing Science 2019 Question 16