Q14Numerical5 Marks22 Dec 2024
The given pseudocode is executed using a dataset having the same fields as the "Words" dataset, and contains the following words:
"The experience was simply wonderful. The product quality is fantastic, and I would definitely recommend it to others. It is not only affordable but also has an excellent design. Overall, I believe it is a great choice for anyone looking for a reliable product."
Consider the following information:
1. unique(L) returns a list of unique elements of list L. For example, unique(["think", "like", "toppers", "think"]) will return ["think", "like", "toppers"].
2. comNo(L1, L2) returns the number of common elements in lists L1 and L2. Ignore the upper and lower case, and punctuation symbols while comparing with other words.
What will the value of posSen be at the end of the execution of the above pseudocode?
```
positiveList = ["wonderful", "reliable", "excellent", "affordable", "great", "fantastic"]
posSen = 0, L = []
while(Table 1 has more rows){
Read the first row X in Table 1
L = L ++ [X.Word]
if(X.Word ends with full stop){
L = unique(L)
posCount = comNo(positiveList, L)
if(posCount >= 2){
posSen = posSen + 1
}
L = []
}
Move X to Table 2
}
```
Press Enter to check.