Week 3 Graded Assignment Question 12) Doubt

83 views
Skip to first unread message

Aritra Roy

unread,
Nov 2, 2020, 2:21:02 PM11/2/20
to Discussion forum for Computational Thinking
What is the error in line 11? I can find none as verb checking has already been done in the AddIfVerb procedure below and  hence, no need to add a 'and X.PartOfSpeech==verb) in the if statement of line 11. Please clarify,

ARIJIT DUTTA

unread,
Nov 2, 2020, 2:29:13 PM11/2/20
to Aritra Roy, Discussion forum for Computational Thinking
Dear Aritra,
                      Step 1 to 06 is for verb related issues..
Step 07 to 15 is where you are taking out each card one by one again and then checking if it is a verb and has more length than avg verb-length.

Step 06 to 22 , for procedure part only.

ARIJIT DUTTA


On Tue, Nov 3, 2020, 00:51 Aritra Roy <roy20...@gmail.com> wrote:
What is the error in line 11? I can find none as verb checking has already been done in the AddIfVerb procedure below and  hence, no need to add a 'and X.PartOfSpeech==verb) in the if statement of line 11. Please clarify,

--
You received this message because you are subscribed to the Google Groups "Discussion forum for Computational Thinking" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cs1001-discus...@nptel.iitm.ac.in.
To view this discussion on the web visit https://groups.google.com/a/nptel.iitm.ac.in/d/msgid/cs1001-discuss/108a88a5-bda7-4d14-8e26-4208b0f13129n%40nptel.iitm.ac.in.

Tejasvi Hegde

unread,
Nov 2, 2020, 2:35:36 PM11/2/20
to Discussion forum for Computational Thinking, roy20...@gmail.com
In simple terms... logic needs to have condition to check for Verb!

i.e. it should be If (X.PartOfSpeech == "Verb" and X.LetterCount < AvgT) 

Don't worry even I missed that ;) but now I realized that it was such a silly oversignt.

Ashiesh Kumar J

unread,
Nov 2, 2020, 3:23:34 PM11/2/20
to Discussion forum for Computational Thinking, Tejasvi Hegde, roy20...@gmail.com
Taking same from your answer, I have query for Q 1 Graded 3
Why 
if (X.LetterCount > Avg and X.PartOfSpeech == “Noun”) {
Count = Count + 1
Why not
if (X.PartOfSpeech=="Noun" and X.LetterCount > Avg){
Count  = Count + 1
Which was not in the option. In week 3 tutorial, same sort of question, followed by same condition 
This is for my clarification 

Regards
Reply all
Reply to author
Forward
0 new messages