Q2Comprehension5 Marks13 Apr 2025
Passage
The following pseudocode is executed using the "Scores" dataset. Two students form a study pair if their difference in Mathematics marks are at most 10. Assume that Pile 1 is always restored back after calling studyPair(Pile 1).
Based on the above data, answer the given subquestions.
```
count1 = studyPair(Pile 1)
while(Pile 1 has more cards){
Read the top card X in Pile 1
if(X.CityTown == "Chennai"){
Move X to Pile CHN
}
if(X.CityTown == "Bengaluru"){
Move X to Pile BLR
}
if(X.CityTown == "Vellore"){
Move X to Pile VLR
}
}
count2 = studyPair(Pile CHN) + studyPair(Pile BLR) + studyPair(Pile VLR)
count3 = count1 - count2
Procedure studyPair(Pile P1)
A = 0
while(Pile P1 has more cards){
Read the first card X from Pile P1
Move X to Pile P2
while(Pile P1 has more cards){
Read the top card Y from Pile P1
Move Y to Pile P3
if(-10 <= X.Mathematics - Y.Mathematics <= 10){
A = A + 1
}
}
Move all cards from Pile P3 to Pile P1
}
return(A)
End studyPair
```
Which of the following statements is/are correct after pseudocode is executed?
--- End of Question Paper (Part-2) ---