Computer Science, asked by aksoni007007, 6 months ago

What will be the values of A, B and C after execution of the following pseudocode using the “Scores” dataset?
A = 0
B=0
C=0
while (Pile 1 has more cards) {
Read the top card X in Pile 1

if (X.MathematicsMarks > X.PhysicsMarks) {
A = A+1
if (X.MathematicsMarks < X.PhysicsMarks) {
B=B+1
}

if (X.MathematicsMarks = X.PhysicsMarks) {
C = C+1
Move X to Pile 2

Answers

Answered by netperson08
28

Answer:

A=16

B=13

C=1

this is the correct answer

Answered by Afreenakbar
0

Answer:

The Pseudocode will depends on the actual score will set on.

Explanation:

The values of A, B, and C after executing the pseudocode will depend on the actual data in the "Scores" dataset and the conditions specified in the code.

A, B, and C are initialized to 0. The while loop will keep executing as long as there are more cards in Pile 1. For each iteration, the top card X is read from Pile 1 and its MathematicsMarks and PhysicsMarks are compared.

If X.MathematicsMarks > X.PhysicsMarks, then A is increased by 1. If X.MathematicsMarks < X.PhysicsMarks, then B is increased by 1. If X.MathematicsMarks = X.PhysicsMarks, then C is increased by 1 and the card X is moved to Pile 2.

This process will repeat until there are no more cards in Pile 1. The final values of A, B, and C will depend on how many cards satisfy each of the three conditions in the code.

Similar Question:

https://brainly.in/question/55146977

https://brainly.in/question/2359999

#SPJ2

Similar questions