Q24.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` represents number of sentences with average letter count less than the average letter count of dataset. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).
```
SumT = 0, CountT = 0, B = 0
while(Table 1 has more rows){
Read the first row X in Table 1
CountT = CountT + 1
SumT = SumT + X.LetterCount
Move X to Table 2
}
B = SumT / CountT
SumS = 0, CountS = 0, A = 0, C = 0
while(Table 2 has more rows){
Read the first row X in Table 2
CountS = CountS + 1
SumS = SumS + X.LetterCount
if(X.Word ends with a full stop){
C = SumS / CountT
if(C > B){
A = A + 1
}
SumS = 0, CountS = 0
}
Move X to Table 1
}
```
Save
Check
Details
Q24
7 Jul 2024
Q24.The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` represents number of sentences with average letter count less than the average letter count of dataset. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).
```
SumT = 0, CountT = 0, B = 0
while(Table 1 has more rows){
Read the first row X in Table 1
CountT = CountT + 1
SumT = SumT + X.LetterCount
Move X to Table 2
}
B = SumT / CountT
SumS = 0, CountS = 0, A = 0, C = 0
while(Table 2 has more rows){
Read the first row X in Table 2
CountS = CountS + 1
SumS = SumS + X.LetterCount
if(X.Word ends with a full stop){
C = SumS / CountT
if(C > B){
A = A + 1
}
SumS = 0, CountS = 0
}
Move X to Table 1
}
```