Q20.The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution?
```
A = 0
while(Pile 1 has more cards){
Read the top card X from Pile 1
A = A + isInSeq(X)
Move X to Pile 2
}
Procedure isInSeq(X)
if(X.Physics < X.Mathematics){
if(X.Mathematics < X.Chemistry){
return(1)
}
}
return(0)
End isInSeq
```
Save
Check
Details
Q20
7 Jul 2024
Q20.The following pseudocode is executed using the "Scores" dataset. What will `A` represent at the end of the execution?
```
A = 0
while(Pile 1 has more cards){
Read the top card X from Pile 1
A = A + isInSeq(X)
Move X to Pile 2
}
Procedure isInSeq(X)
if(X.Physics < X.Mathematics){
if(X.Mathematics < X.Chemistry){
return(1)
}
}
return(0)
End isInSeq
```