Question 8
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. It is a Multiple Select Question (MSQ).
1 C = 0 2 while(Table 1 has more rows){ 3 Read the first row X from Table 1 4 if(CheckSomething(X, 4, 8)){ 5 C = C + 1 6 } 7 Move X to Table 2 8 } 9 Procedure CheckSomething(Y, C1, C2)10 if(Y.PartOfSpeech == "Noun"){11 if(C1 <= Y.LetterCount and Y.LetterCount <= C2){12 return(True)13 }14 else{15 return(False)16 }17 }18 else{19 return(False)20 }21 End CheckSomethingError in Line 1
Error in Line 4
Error in Line 5
Error in Line 10
Error in Line 11
Multiple return(False) in procedure CheckSomething
No error