Computational Thinking Support 2
unread,Nov 18, 2020, 1:56:09 AM11/18/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, aniru...@gmail.com, priyanshu...@gmail.com
Hi,
Whatever Aniruddan has explained is correct. I want to add something in that.
In flowchart, Found and Count are initialized with False and 0 respectively. When we check in first decision box for the first card it becomes true both cases (Another card and not(Found) >> first card and not(False) >> first card and True >> True).
So it will go to next decision box of the Correct card? and this will be also true because in the question it is mentioned that all 10 cards satisfy the condition for the "Correct card". Then after it will go to the activity box where Found will be changed to True and Count will be incremented by 1.
Now it will return back to first decision box where it will check for second card and not(Found). Since we have now 9 cards so the first part in decision box is true. Now for second part which is not(Found) >> not(True) >> False. So first part is true but second part is false. Therefore overall it will be false and will terminate/stop the program.
Hence Count will be 1 only since it was incremented once by one. So answer will 1.
Hope your doubt is cleared if not write us again.
Regards,
Deepak
IITM Online Degree Team