Prasnya
Prasnya
Prasnya
Continue with Google
Question 2 - Week 1 Practice | Prasnya
Q2
00:00
13 Jul 2025
Q2.
Consider the flowchart shown below. Which of the following pseudocode is correct for the given flowchart?
A
``` Sum = 0 while (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 while (X.Gender == M) { Sum = Sum + X.Maths } else } ```
B
``` Sum = 0 if (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 if (X.Gender == M) { Sum = Sum + X.Maths } } ```
C
``` Sum = 0 while (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 if (X.Gender == M) { Sum = Sum + X.Maths } } ```
D
``` Sum = 0 if (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 while (X.Gender == M) { Sum = Sum + X.Maths } } ```
Save
Check
Details
Q2
00:00
13 Jul 2025
Q2.
Consider the flowchart shown below. Which of the following pseudocode is correct for the given flowchart?
A
``` Sum = 0 while (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 while (X.Gender == M) { Sum = Sum + X.Maths } else } ```
B
``` Sum = 0 if (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 if (X.Gender == M) { Sum = Sum + X.Maths } } ```
C
``` Sum = 0 while (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 if (X.Gender == M) { Sum = Sum + X.Maths } } ```
D
``` Sum = 0 if (Pile 1 has more cards) { Pick a card X from Pile 1 Move X to Pile 2 while (X.Gender == M) { Sum = Sum + X.Maths } } ```
Save
Check
Details