Q24.The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph.
"Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic."
What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters.
```
count = 0, flag = True
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
if(1st letter of X.Word == 's' and flag){
if(2nd letter of X.Word == 'o'){
count = count + 1
}
}
if(X.Word ends with full stop){
flag = False
}
}
```
Save
Check
Details
Q24
27 Oct 2024
Q24.The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph.
"Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic."
What would be the value of `count` at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters.
```
count = 0, flag = True
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
if(1st letter of X.Word == 's' and flag){
if(2nd letter of X.Word == 'o'){
count = count + 1
}
}
if(X.Word ends with full stop){
flag = False
}
}
```