doubt in week 3

23 views
Skip to first unread message

Bindu shiva

unread,
Nov 13, 2020, 2:23:24 PM11/13/20
to Discussion forum for Computational Thinking
PLEASE HELP ME CLEAR THE BELOW DOUBTS 
COULD ANYONE EXPLAIN WEEK 3 ACTIVITY 8 QN 5?
AND QN 7 IN ACTIVITY 6 OF WEEK 3
KINDLY EXPLAIN THE SUBJECT TOPPER PROCEDURE USED IN THE PSEUDOCODE FOR THREE PRICES.

Computational Thinking Support 2

unread,
Nov 16, 2020, 1:03:20 AM11/16/20
to Discussion forum for Computational Thinking, bindush...@gmail.com
This is the continuation of the question 4. Where SubjectTopper is the procedure name and inside bracket,  Card, MMark, PMark, CMark   are parameters.
When we call a procedure SubjectTopper(Card, MMark, PMark, CMark)  using the parameter values  SubjectTopper(X, 0, 0, 0), what it is implying is
Inside the procedure Card = X, MMark=0,PMark = 0, CMark = 0
Hope the doubt is cleared.

The procedure SubjecTopper is checking if the student is a topper in at least one of the three subjects. If the student has topped in at least one subject, the procedure will return the value True. If not, it will return the value False. So, the value returned by this procedure is either True or False. Hence its datatype is boolean.

In qNo. 7 the procedure is assigned with an value. Here procedure is not a variable, we can call a procedure to do specific tasks  but we cannot assign  Vlue to the procedure.
  
Regards,
Nijin
IITM Online Degree Programme. 
Reply all
Reply to author
Forward
0 new messages