cheria...@gmail.com
unread,Nov 12, 2020, 11:54:34 PM11/12/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Discussion forum for Computational Thinking, Shubham Johri, Discussion forum for Computational Thinking, Naushad C.K., Snigdha Lele, Antony, krishnam...@gmail.com
Line 20 need not be considered an error.
If line 20 is left as it is. Proc2 will always return only a negative value or zero.
If the sign is the opposite, Proc2 will always return only a positive value or zero.
Error in line 1 : Z=0
Error in line 10 : value = value - Proc2(X.Total,Y.Total)
Line 20 can be left as it is and the pseudo code will generate the same outcome. Therefore Line 20 need not be considered an error.
Example :
Case 1: Leave line 20 as it is :
Proc2(X.Maths,Y.Maths) = -10
Proc2(x.Physics,Y.Physics) = -20
Proc2(X.Chemistry,Y.Chemistry) = -40
Proc2(X.Total,Y.Total)= -70
Line 10 = value = -70 - (-70) = 0
Case 2: Change the comparison operator line 20 :
Proc2(X.Maths,Y.Maths) = 10
Proc2(x.Physics,Y.Physics) = 20
Proc2(X.Chemistry,Y.Chemistry) = 40
Proc2(X.Total,Y.Total)= 70
Line 10 = value = 70 - 70 = 0