Question 9
The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?
1 A = 0 2 while(Pile 1 has more cards){ 3 Read the top card X from Pile 1 4 A = A + isInSeq(X) 5 Move X to Pile 2 6 } 7 8 Procedure isInSeq(X) 9 if(X.Mathematics > X.Physics){10 if(X.Chemistry < X.Mathematics){11 return(1)12 }13 }14 return(0)15 End isInSeqNumber of students with highest marks in Mathematics among the three subjects
Number of students with highest marks in Mathematics and lowest marks in Physics
Number of students with highest marks in Chemistry among the three subjects
Number of students with lowest marks in Physics among the three subjects