Q43.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `C` captures the number of nouns with letter count at least four and at most eight. 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.
```
C = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(CheckSomething(X, 4, 8)){
C = C + 1
}
Move X to Table 2
}
Procedure CheckSomething(Y, C1, C2)
if(Y.PartOfSpeech == "Noun"){
if(C1 <= Y.LetterCount and Y.LetterCount <= C2){
return(True)
}
else{
return(False)
}
}
else{
return(False)
}
End CheckSomething
```
Save
Check
Details
Q43
10 Jul 2022
Q43.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `C` captures the number of nouns with letter count at least four and at most eight. 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.
```
C = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(CheckSomething(X, 4, 8)){
C = C + 1
}
Move X to Table 2
}
Procedure CheckSomething(Y, C1, C2)
if(Y.PartOfSpeech == "Noun"){
if(C1 <= Y.LetterCount and Y.LetterCount <= C2){
return(True)
}
else{
return(False)
}
}
else{
return(False)
}
End CheckSomething
```