Q32.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books that are released in the same year and under the same genre but in different languages. 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.
```
A = 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 the first row Y from Table 1
B = False, C = False, D = True
if(X.Genre == Y.Genre){
B = True
}
if(X.Year == Y.Year){
C = False
}
if(X.Language == Y.Language){
D = False
}
if(B or C or D){
A = A + 1
}
Move Y to Table 3
}
Move all rows from Table 3 to Table 1
}
```
Save
Check
Details
Q32
10 Jul 2022
Q32.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books that are released in the same year and under the same genre but in different languages. 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.
```
A = 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 the first row Y from Table 1
B = False, C = False, D = True
if(X.Genre == Y.Genre){
B = True
}
if(X.Year == Y.Year){
C = False
}
if(X.Language == Y.Language){
D = False
}
if(B or C or D){
A = A + 1
}
Move Y to Table 3
}
Move all rows from Table 3 to Table 1
}
```