The problem has two parts. Part (a) presents criteria for selecting school prefects based on student marks and asks to: (i) identify prefects from a table and (ii) complete a pseudo-code based on the selection criteria. Part (b) describes a flowchart involving dice rolls, and asks to identify substitutes for A, B, C, and D.
2025/6/29
1. Problem Description
The problem has two parts. Part (a) presents criteria for selecting school prefects based on student marks and asks to: (i) identify prefects from a table and (ii) complete a pseudo-code based on the selection criteria. Part (b) describes a flowchart involving dice rolls, and asks to identify substitutes for A, B, C, and D.
2. Solution Steps
(a)(i) Identifying prefects based on the given criteria:
* Criterion 1: Average marks >= 65
* Criterion 2: Certificate marks >= 50
* Criterion 3: Teacher's marks >= 60
We examine each student:
* Kamal: Avg = 75 >= 65 (True), CF = 34 >= 50 (False), T = 63 >= 60 (True). Since CF is not >= 50, Kamal does not qualify.
* Anjana: Avg = 65 >= 65 (True), CF = 52 >= 50 (True), T = 55 >= 60 (False). Since T is not >= 60, Anjana does not qualify.
* Pathum: Avg = 75 >= 65 (True), CF = 86 >= 50 (True), T = 70 >= 60 (True). Pathum qualifies.
* Wikum: Avg = 34 >= 65 (False), CF = 30 >= 50 (False), T = 60 >= 60 (True). Since Avg is not >=65, Wikum does not qualify.
(a)(ii) Completing the pseudo-code:
The pseudo-code outlines the steps to determine prefect eligibility. We need to fill in P, Q, R, and S.
* P: This should incorporate the teacher's marks. Since the Avg_marks and CF_marks are already inputted, the teacher's marks (Tmarks) needs to be inputted too. So, P = Tmarks.
* Q: This needs to check if the teacher's marks are greater than or equal to
6
0. So, Q =
6
0. * R: If the CF_marks are >= 50, then the student is qualified. Hence R = Qualified to Prefect
* S: If none of the criteria are met, then the student is not qualified. S is therefore, Not Qualified to Prefect
(b) Determining substitutes for A, B, C, D:
The flowchart counts how many dice rolls result in a value of 5 or more.
* A: 'count' is initialized to A. Since we want to count the number of times a number is equal to 5 or more, we need to initialize the count to
0. Therefore, A =
0. * B: 'T' is initialized to B. This variable "T" seems to be used as an index to iterate through the array N containing the results of the 8 dice rolls. We need to start from the first value. Thus, B =
0. * C: N[T] >= C checks if the T-th dice roll is greater than or equal to some number. The problem wants the number of times that 5 or more are obtained. Hence C should be the integer
5. Thus, C =
5. * D: D is assigned at the end if T<8 is false. If T<8 is false then T=8 (since T starts from 0). This would mean that all of the rolls have been checked, and the flow chart should exit. Thus, D = Count.
3. Final Answer
(a)(i) Pathum
(a)(ii)
P = Tmarks
Q = 60
R = Qualified to Prefect
S = Not Qualified to Prefect
(b)
A = 0
B = 0
C = 5
D = Count