Q39.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the number of female students who are above average in at least one subject. Assume that the variables `M`, `P`, and `C` hold the average marks of Mathematics, Physics, and Chemistry respectively. 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.
```
A = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(CheckSomething(X, M, P, C)){
A = 1
}
Move X to Table 2
}
Procedure CheckSomething(Y, C1, C2, C3)
if(Y.Gender == "F"){
if(Y.Mathematics > C1 and Y.Physics > C2 and Y.Chemistry > C3){
return(True)
}
else{
return(False)
}
}
else{
return(False)
}
End CheckSomething
```
Save
Check
Details
Q39
5 Jun 2022
Q39.The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `A` captures the number of female students who are above average in at least one subject. Assume that the variables `M`, `P`, and `C` hold the average marks of Mathematics, Physics, and Chemistry respectively. 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.
```
A = 0
while(Table 1 has more rows){
Read the first row X from Table 1
if(CheckSomething(X, M, P, C)){
A = 1
}
Move X to Table 2
}
Procedure CheckSomething(Y, C1, C2, C3)
if(Y.Gender == "F"){
if(Y.Mathematics > C1 and Y.Physics > C2 and Y.Chemistry > C3){
return(True)
}
else{
return(False)
}
}
else{
return(False)
}
End CheckSomething
```