AQ3.8: Activity Question 8 - Not graded

423 views
Skip to first unread message

Ram Mohan M

unread,
Nov 19, 2020, 2:04:08 AM11/19/20
to Discussion forum for Computational Thinking
Consider the following code-block in the procedure TopThreeMarks(Subj) discussed in the lecture:



Assume that we call the procedure TopThreeMarks(Maths). At an intermediate stage in the execution of this procedure, we find the variables having the following values:

max = 88, secondmax = 76, thirdmax = 68

For the next card that we pick up from Pile 1, the condition in the above if statement evaluates to true. What could be the smallest value of the maths marks on this card? 

how the answer is 89 can anyone pls reply... 

Yogendra Shakya

unread,
Nov 19, 2020, 6:17:23 AM11/19/20
to Discussion forum for Computational Thinking, Ram Mohan M
from what i understood, the procedure evaluates to true means the first condition where it says X.subj>max is applicable.. which means the card we have in hand has marks greater than current max .. and current max is 88. so the he next least number to be to evaluate true is 89.

Computational Thinking Support 2

unread,
Nov 20, 2020, 5:42:35 AM11/20/20
to Discussion forum for Computational Thinking, Yogendra, Ram Mohan M
Hi Ram,
Whatever Yogendra has explained is correct. You can go through his explanation.
If you still have doubt please write us again.

Regards,
Deepak
IITM Online Degree Team
Reply all
Reply to author
Forward
0 new messages