Q44.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the number of sentences with at least two nouns that have at most 2 vowels. 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, C = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(X.PartOfSpeech == "Noun" and CountVowels(X) <= 2){
C = C + 1
}
if(X.Word ends with a full stop){
if(C >= 2){
A = A + 1
C = 0
}
}
Move X to Table 2
}
Procedure CountVowels(Y)
i = 1, B = 0
while(i <= Y.LetterCount){
if(ith letter of Y.Word is a vowel){
B = B - 1
i = i + 1
}
}
return(B)
End CountVowels
```
Save
Check
Details
Q44
10 Jul 2022
Q44.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` captures the number of sentences with at least two nouns that have at most 2 vowels. 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, C = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(X.PartOfSpeech == "Noun" and CountVowels(X) <= 2){
C = C + 1
}
if(X.Word ends with a full stop){
if(C >= 2){
A = A + 1
C = 0
}
}
Move X to Table 2
}
Procedure CountVowels(Y)
i = 1, B = 0
while(i <= Y.LetterCount){
if(ith letter of Y.Word is a vowel){
B = B - 1
i = i + 1
}
}
return(B)
End CountVowels
```