Step 3 of Question No 6 of Practice Assignment (Week 1)

53 views
Skip to first unread message

Jameel Kaisar

unread,
Oct 10, 2020, 4:51:08 PM10/10/20
to Discussion forum for Computational Thinking
I think step 3 of Question No 6 of Practice Assignment (Week 1) is wrong. The step says "If Pile 1 is empty then stop the execution". If execution is stopped, then steps 9 to 12 won't get executed which means variable X won't be created and X does not represent anything. In that case option 6 ("None of the above") would be correct and not the option 4 ("Number of stores which Neeraja visited").

We need to stop iterator when pile 1 is empty and not the execution.  

For option 6 to be correct, I think step 3 should have been "If Pile 1 is empty then move to step 9".

If I am wrong, please explain the reason.

Ritik Bairagi

unread,
Oct 10, 2020, 6:59:19 PM10/10/20
to Discussion forum for Computational Thinking, jameelka...@gmail.com
it's not needed to create the variable again and again , even if it's in the iteration ,its counted only once , it just create a memory space for variable X , so , if in the first loop of iteration 1 pile is empty then there is no need to create a variable X. 
Reply all
Reply to author
Forward
0 new messages