Q21.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students who are of the same gender or are from the same city but not both. Choose the correct code fragment(s) to complete the pseudocode.
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
while(Table 1 has more rows){
Read the first row Y in Table 1
Move Y to Table 3
count = count + findPair(X, Y)
}
Move all rows from Table 3 to Table 1
}
Procedure findPair(X, Y)
**** Fill the code ****
End findPair
```
Save
Check
Details
Q21
16 Jul 2023
Q21.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students who are of the same gender or are from the same city but not both. Choose the correct code fragment(s) to complete the pseudocode.
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
while(Table 1 has more rows){
Read the first row Y in Table 1
Move Y to Table 3
count = count + findPair(X, Y)
}
Move all rows from Table 3 to Table 1
}
Procedure findPair(X, Y)
**** Fill the code ****
End findPair
```