0478_m24_qp_22
A paper of Computer Science, 0478
Questions:
11
Year:
2024
Paper:
2
Variant:
2

Login to start this paper & get access to powerful tools

2
3
5
8
9
11
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.