IGCSE Coding Questions
IGCSE Coding Questions
Students in a class are recording the amount of time in minutes spent in front
of a screen for each day of the week.
The one-dimensional (1D) array StudentName[] contains the names of the
students in the class. The two-dimensional (2D) array ScreenTime[] is used to
input the number of minutes on each day spent in front of a screen.
The position of each student’s data in the two arrays is the same. For
example, the student stored at index 10 in StudentName[] and ScreenTime[]
is the same.
The variable ClassSize contains the number of students in the class. Write a
program that meets these requirements:
• allows all the students to enter their daily minutes of screen times for the
past week
• calculates the total number of minutes of screen time for each student in the
week
• counts, for each student, the number of days with more than 300 minutes of
screen time
• calculates the average weekly minutes of screen time for the whole class
• finds the student with the lowest weekly minutes of screen time
• outputs for each student: – name – total week’s screen time in hours and
minutes – number of days with more than 300 minutes of screen time
• outputs the average weekly minutes of screen time for the whole class
• outputs the name of the student with the lowest weekly screen time.
You must use pseudocode or program code and add comments to explain
how your code works.
All inputs and outputs must contain suitable messages. Assume that the array
StudentName[] and the variable ClassSize already contain the required data.
You do not need to declare any arrays or variables; you may assume that this
has already been done.
3. Describe two types of iteration that a programmer can use whilst writing a
program.
5. An algorithm has been written to test if an integer that is input is in the range 5
to 10 inclusive. Identify an example of suitable test data for each test data
type.