Q8.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of students whose mathematics marks are not the same as any other student. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors.
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
Flag = True
while(Table 1 has more rows){
Read the first row Y in Table 1
if(X.Mathematics == Y.Mathematics){
Flag = True
Move Y to Table 2
}
else{
Move Y to Table 3
}
}
if(Flag){
count = count + 1
}
Move all rows from Table 3 to Table 1
}
```
Save
Check
Details
Q8
13 Jul 2025
Q8.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of students whose mathematics marks are not the same as any other student. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors.
```
count = 0
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
Flag = True
while(Table 1 has more rows){
Read the first row Y in Table 1
if(X.Mathematics == Y.Mathematics){
Flag = True
Move Y to Table 2
}
else{
Move Y to Table 3
}
}
if(Flag){
count = count + 1
}
Move all rows from Table 3 to Table 1
}
```