Q29.The following pseudocode is executed using the "Words" dataset. At the end of execution, `count` stores the number of pairs of consecutive words which have equal number of vowels. Choose the correct option(s).
```
count = 0
while(Table 1 has at least two rows) {
Read the first row X from Table 1
countX = countSomething(X)
Move X to Table 2
Read the first row Y from Table 1
countY = countSomething(Y)
if(countX == countY) {
count = count + 1
}
}
Procedure countSomething(Z)
i = 1
A = 0
while(i <= Z.LetterCount) {
if(ith letter of Z.Word is vowel) {
A = A + 1
}
i = i + 1
}
return(A)
End countSomething
```
Save
Check
Details
Q29
29 Oct 2023
Q29.The following pseudocode is executed using the "Words" dataset. At the end of execution, `count` stores the number of pairs of consecutive words which have equal number of vowels. Choose the correct option(s).
```
count = 0
while(Table 1 has at least two rows) {
Read the first row X from Table 1
countX = countSomething(X)
Move X to Table 2
Read the first row Y from Table 1
countY = countSomething(Y)
if(countX == countY) {
count = count + 1
}
}
Procedure countSomething(Z)
i = 1
A = 0
while(i <= Z.LetterCount) {
if(ith letter of Z.Word is vowel) {
A = A + 1
}
i = i + 1
}
return(A)
End countSomething
```