Week 2 Graded Assignment Q5 Confusion

219 views
Skip to first unread message

Shubham

unread,
Oct 26, 2020, 11:20:14 AM10/26/20
to Discussion forum for Computational Thinking
In week 2 Graded Assignments Question 5 1 Step initializes max to 1. Technically that's wrong but according to our data even it works. So do we consider the statement error or correct?

Rhea Jain

unread,
Oct 26, 2020, 11:57:20 AM10/26/20
to Discussion forum for Computational Thinking, shubh...@gmail.com
Hi,
Although this works but it is not the best practice. I would consider this to be an error. However, in context of how this assignment is marked, I can only guess, I am not sure if selecting this mistake is expected.

Aniruddha Patil

unread,
Oct 26, 2020, 2:48:09 PM10/26/20
to Discussion forum for Computational Thinking, rheajai...@gmail.com, shubh...@gmail.com
Hi,
  I also marked that step as mistake. Initializing max to 1 seemed a technical mistake since the highest amount can technically take value of 1. We can wait till the query gets answered.

suyash bajpai

unread,
Oct 26, 2020, 2:51:36 PM10/26/20
to Discussion forum for Computational Thinking, 08anirud...@gmail.com, rheajai...@gmail.com, shubh...@gmail.com
I have also marked it as a wrong step because the initial value must not take a value which is possible in the dataset

Anish Yalavarthi

unread,
Oct 26, 2020, 2:54:02 PM10/26/20
to Discussion forum for Computational Thinking, 08anirud...@gmail.com, rheajai...@gmail.com, shubh...@gmail.com
Basically for the max variable we can initialize any value less than the given total amount generated in the shopping bills dataset

Ajey

unread,
Oct 26, 2020, 3:02:16 PM10/26/20
to Discussion forum for Computational Thinking
Even I marked it as a mistake. Considering the hypothetical that a shop's highest sale was a 50 paise, (Rs. 0.5) chocolate, paid electronically via E-Wallets or BHIM (Promoting Digital India)! Even if it is not the highest sale value, it could have been the first sale, and the psuedo-code would have ignored it. Also we should not refer back to the total sale values of the shopping bills dataset, I guess, 'cause it is a general question and I think the question just aimed at specifying the data types by stating "from the “Shopping Bills” dataset.", which for total bill amount is a subtype of integer with min 0, not 1.
(Also a hypothetical, but the whole amount of the bill could have written of due to some promo code, although there is no provision of promo code in the question, so it is a bit irrelevant).

Anmol Varshney

unread,
Oct 26, 2020, 3:04:49 PM10/26/20
to Discussion forum for Computational Thinking, Anish Yalavarthi, 08anirud...@gmail.com, rheajai...@gmail.com, shubh...@gmail.com
the correct answer should be step 2 and step 5 although considering step as correct will not make any difference in finding the highest amount of bill generated at “Sun General” from the “Shopping Bills” dataset but the question asked to find the steps where the programmer may have made mistakes, and in this case we can always consider to initialise the max variable to 0 as from the perspective of a programmer, he/she should initialise the variable max with value 0.

In this particular question, I can also initialise the variable max to a value higher than 1 (say 2) and still it will give the correct answer in finding the highest amount of bill generated at “Sun General”. So, step 2 should be consider as a mistake.
Reply all
Reply to author
Forward
0 new messages