Indentation at the End of a Procedure

126 views
Skip to first unread message

nibedita chakraborty

unread,
Nov 2, 2020, 9:51:00 AM11/2/20
to Discussion forum for Computational Thinking




Sir,
On comparing the above 2 screenshot (one from tutorial3.3 and another from lecture3.7) we see that the ending of the procedure ('end AddIfBibBazar' or 'end MaxMarks ') have different indentation. Please specify which one of the two is correct.
Thank you.

Your Sincerely
Nibedita

tukaie...@gmail.com

unread,
Nov 3, 2020, 10:24:40 AM11/3/20
to Discussion forum for Computational Thinking
Both are correct, because it is a pseudocode , its only used to make it easy to read the code(And you should use it, it helps a lot in the long run). You can also notice that in the first example the "End AddIfBigBazzar" End starts with capital "E" but in the second  one it starts with small "e" ,which will result in an error if used in a real code , Though I don't want to go deep into this discussion , when you learn more about this you will come to know in a language like Python , you will see "end" is not even used to end a procedure or a function . So to keep things simple for now remember this is a good way to learn and understand code by using Pseudocodes. Different languages have different syntaxes but the same base logic behind them .Like in python indentation effects the code but in a language like Java indentation doesn't matter .
.

Reply all
Reply to author
Forward
0 new messages