Word end with full stop doubt

59 views
Skip to first unread message

piyush

unread,
Nov 20, 2020, 12:14:19 PM11/20/20
to Discussion forum for Computational Thinking
Sir,
In mock test, Q2

 X.word end with a full stop,
A=A+X.letter count
Here only Sum of letter count of words which are the end of each sentence is taken but in wk2 graded assignment Q3 step 7, if word end with a full stop, it's used to find length of complete sentence.

Kindly explain the difference in the same please.

Thanks & Regards
Piyush Chaurasia

Computational Thinking Support 2

unread,
Nov 20, 2020, 10:15:44 PM11/20/20
to Discussion forum for Computational Thinking, piyush.c...@gmail.com
Hi,
In mock test Q2, X.LetterCount is added to A only if the word ends with a full stop. So A here stores sum of letter count of words which are at the end of each sentence.
Whereas in Week2 GA Q3, Letter count is added to variable B up to when word ends with full stop. Then B is stored in A after comparing with value of A and then B is reinitialized to 0. So here A stores length of the longest sentence based on the number of characters.

Don't confuse with same variable used in different problems. Try to understand the concept used in the problems.
Hope  your doubt is cleared if not write us again.

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