Q7.A mysterious grading system defines "Mirror Match Pairs" between students as follows:
Two students form a Mirror Match Pair (asymmetric relation) if:
a) The Mathematics score of the first student is equal to the reverse of the Chemistry score of the second student, and
b) The Total marks of the first student are exactly 3 more than those of the second student, and
c) They do not have the same name.
Procedure `ReverseDigits()` can take any marks as argument and return the reversed marks. The following pseudocode is executed using the "Scores" dataset.
```
count = 0
while(Table 1 has more rows){
Read the first row X from Table 1
Move X to Table 2
while(Table 1 has more rows){
Read a row Y from Table 1
if(X.Name != Y.Name){
revY = ReverseDigits(Y.Chemistry)
revX = ReverseDigits(X.Chemistry)
***********************
*** Fill the code ***
***********************
}
Move Y to Table 3
}
Move all rows from Table 3 back to Table 1
}
```
Choose the correct code fragment to complete the pseudocode.
Save
Check
Details
Q7
13 Jul 2025
Q7.A mysterious grading system defines "Mirror Match Pairs" between students as follows:
Two students form a Mirror Match Pair (asymmetric relation) if:
a) The Mathematics score of the first student is equal to the reverse of the Chemistry score of the second student, and
b) The Total marks of the first student are exactly 3 more than those of the second student, and
c) They do not have the same name.
Procedure `ReverseDigits()` can take any marks as argument and return the reversed marks. The following pseudocode is executed using the "Scores" dataset.
```
count = 0
while(Table 1 has more rows){
Read the first row X from Table 1
Move X to Table 2
while(Table 1 has more rows){
Read a row Y from Table 1
if(X.Name != Y.Name){
revY = ReverseDigits(Y.Chemistry)
revX = ReverseDigits(X.Chemistry)
***********************
*** Fill the code ***
***********************
}
Move Y to Table 3
}
Move all rows from Table 3 back to Table 1
}
```
Choose the correct code fragment to complete the pseudocode.