Q19.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of books which are published by "Penguin" or written by the author "Narayan". The pseudocode may have mistakes. Identify all such mistakes (if any). It is a Multiple Select Question (MSQ).
```
A = 0
while(Table 1 has more rows){
Read the first row X in Table 1
C = True
if(X.Publisher == "Penguin"){
C = True
}
if(X.Author == "Narayan"){
C = False
}
if(C){
A = A + 1
}
Move X to Table 2
}
```
Save
Check
Details
Q19
27 Oct 2024
Q19.The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of books which are published by "Penguin" or written by the author "Narayan". The pseudocode may have mistakes. Identify all such mistakes (if any). It is a Multiple Select Question (MSQ).
```
A = 0
while(Table 1 has more rows){
Read the first row X in Table 1
C = True
if(X.Publisher == "Penguin"){
C = True
}
if(X.Author == "Narayan"){
C = False
}
if(C){
A = A + 1
}
Move X to Table 2
}
```