Practice Assignment Question # 6

113 views
Skip to first unread message

Rohit Kumar

unread,
Oct 10, 2020, 1:59:01 AM10/10/20
to Discussion forum for Computational Thinking
In the Given question, the Value of X is incremented by 1 if A, B, and C are 1 respectively. But In due course, it is possible that Neeraja has shopped from a store twice. Then the value of X will not be incremented by 1 as the value of a particular store has a value of 2.

In my opinion, the value of X signifies " Number of stores which Neeraja visited Once" but there is no such option.

So the answer should be None of The Above 



PA1_CT_IITMOD.png

Computational Thinking Support 2

unread,
Oct 10, 2020, 5:37:42 AM10/10/20
to Discussion forum for Computational Thinking, Rohit Kumar
Consider this rephrasing of the correct option:

The number of different shops which Neeraja has visited.

Does this make more sense? X holds the number of different shops Neeraja has visited. For example, if there is someone who has visited Sun General and SV Stores, X would have the value 2. If someone has visited all three, X would store 3. In this case, Neeraja has visited only SV Stores, so X stores the value 1.

_Music_Viking

unread,
Oct 10, 2020, 6:25:09 AM10/10/20
to Discussion forum for Computational Thinking, ct-su...@onlinedegree.iitm.ac.in, Rohit Kumar
@rohitkumar 
Even if Neereja visits any store twice (or even more than 2 times), the value (in this case, A or B or C) will be 1, i.e., it doesn't increase. This is because the algorithm is written in such a way that it only sets the values of A or B or C to 1(it's either 0 or 1). On the other hand, the variable X is allowed to be increased. This obviously gives us the required answer.
Thank you

Rohit Kumar

unread,
Oct 10, 2020, 7:22:15 AM10/10/20
to Discussion forum for Computational Thinking, _Music_Viking, ct-su...@onlinedegree.iitm.ac.in, Rohit Kumar
Thank you so much. 

Thanks 

Lokesh Anand

unread,
Oct 13, 2020, 11:25:15 AM10/13/20
to Discussion forum for Computational Thinking, _Music_Viking, ct-su...@onlinedegree.iitm.ac.in, Rohit Kumar
I think there is a problem with how steps 5-7 are written. See below:

Step 5. If the shop name is “SV Stores” and customer name is “Neeraja” then set A equal to 1
Step 6. If the shop name is “Big Bazaar” and customer name is “Neeraja” then set B equal to 1
Step 7. If the shop name is “Sun General” and customer name is “Neeraja” then set C equal to 1

It says if shop name is X and customer name is Neeraja, then set A/B/C equal to 1. It says set equal to, but not increment. So this variable can either only be 0 or 1, right?

Let's say Neeraja visits SV stores for the first time, then step 5 will become operational, A sets to 1 and X will be incremented by 1. 
Then Neeraja visits SV stores again, step 5 becomes operational again (A sets to 1), and X will be incremented by 1 again. 

So I think X should represent the numbers of Neeraja's visits to SV Stores, Big Bazaar or Sun General. 

Does this make sense? What am I missing?


On Saturday, October 10, 2020 at 3:55:09 PM UTC+5:30 _Music_Viking wrote:
Reply all
Reply to author
Forward
0 new messages