Q37.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of books which are published after 2010 or have less than the average number of pages. Assume that `Avg` holds the average number of pages of the books in the dataset. 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 in Table 1
C = False
if(X.Year > 2010){
C = True
}
if(X.Pages > Avg){
C = True
}
if(C){
A = 1
}
Move X to Table 2
}
```
Save
Check
Details
Q37
5 Jun 2022
Q37.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of books which are published after 2010 or have less than the average number of pages. Assume that `Avg` holds the average number of pages of the books in the dataset. 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 in Table 1
C = False
if(X.Year > 2010){
C = True
}
if(X.Pages > Avg){
C = True
}
if(C){
A = 1
}
Move X to Table 2
}
```