graded assigment 1, Q7

67 views
Skip to first unread message

Manashree Tendulkar

unread,
Oct 20, 2020, 12:02:25 AM10/20/20
to Discussion forum for Computational Thinking
IN Q7 of the graded assignment-1 how can the answer be "total number of sentences with only one verb in it". Cause a verb can be in the middle of a sentence!

Kishan Jadav

unread,
Oct 20, 2020, 1:14:19 AM10/20/20
to Discussion forum for Computational Thinking, Manashree Tendulkar
Screenshot (1).pngLet us analyse the given procedure, in step 2 two variables A and B are initialized to 0.
In step 5 variable B is getting incremented if part of speech is “Verb” which means variable B
is counting number of verbs. Conditions in steps 6 and 7 are exactly opposite to each other.
As per the combination of steps 6 and 9 we are counting verbs with variable B until we reach
to a full stop. In other words, we are counting number of verbs in each sentence. As per step 7
if a sentence ends and verb count in variable B is 1 then we are incrementing variable A. Step
8 resets the value of variable B so that the same variable can be used to count number of verbs
in the next sentence. Based on this analysis we can conclude that the variable A gets
incremented only if variable B’s value is 1. Hence, the answer of this question is Total number
of sentences with only one verb in it.

Computational Thinking Support 2

unread,
Oct 20, 2020, 1:50:44 AM10/20/20
to Discussion forum for Computational Thinking, kishanj...@gmail.com, Manashree Tendulkar
Manashree, The above explanation given by Kishan is correct.

If you have still doubt please write us again.

Thanks and Regards,
Deepak
IITM Online Degree
Reply all
Reply to author
Forward
0 new messages