Arrays (CIE IGCSE Computer Science)

Topic Questions

1
Sme Calculator
3 marks

All variables, constants and other identifiers should have meaningful names.

i)
Declare the array to store the students’ names.
[1]
ii)
Declare the arrays to store each student’s marks and total score.
[2]

Did this page help you?

2
Sme Calculator
3 marks

The pseudocode algorithm shown has been written by a teacher to enter marks for the students in her class and then to apply some simple processing.

Count ← 0
REPEAT
   INPUT Score[Count]
   IF Score[Count] >= 70
      THEN
         Grade[Count] ← "A"
      ELSE
         IF Score[Count] >= 60
            THEN
               Grade[Count] ← "B"
            ELSE
               IF Score[Count] >= 50
                  THEN
                     Grade[Count] ← "C"
                  ELSE
                     IF Score[Count] >= 40
                        THEN
                           Grade[Count] ← "D"
                        ELSE
                           IF Score[Count] >= 30
                              THEN
                                 Grade[Count] ← "E"
                              ELSE
                                 Grade[Count] ← "F"
                              ENDIF
                           ENDIF
                        ENDIF
                     ENDIF
                  ENDIF
                  Count ← Count + 1
               UNTIL Count = 30

Write the pseudocode to output the contents of the arrays Score[] and Grade[] along with suitable messages.

[3]

Did this page help you?

3
Sme Calculator
3 marks
Using a single loop, write an algorithm in pseudocode to output 50 names that have been stored in the array, Name[]

[3]

Did this page help you?

4
Sme Calculator
15 marks

The 1D array StudentName[ ]contains the names of students in a class. The 2D array StudentMark[ ] contains the mark for each subject, for each student. The position of each student’s data in the two arrays is the same, for example, the student in position 10 in StudentName[ ]and StudentMark[ ]is the same.

The variable ClassSize contains the number of students in the class. The variable SubjectNo contains the number of subjects studied. All students study the same number of subjects.

The arrays and variables have already been set up and the data stored.

Students are awarded a grade based on their average mark.

Average mark Grade awarded
greater than or equal to 70 distinction
greater than or equal to 55 and less than 70 merit
greater than or equal to 40 and less than 55 pass
less than 40 fail


Write a program that meets the following requirements:

  • calculates the combined total mark for each student for all their subjects
  • calculates the average mark for each student for all their subjects, rounded to the nearest whole number
  • outputs for each student:
    – name
    – combined total mark
    – average mark
    – grade awarded
  • calculates, stores and outputs the number of distinctions, merits, passes and fails for the whole class.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to initialise the data in the array.

 [15]

Did this page help you?