related to graded assingment 3 Q-13

50 views
Skip to first unread message

ajeetku...@gmail.com

unread,
Nov 3, 2020, 3:38:36 AM11/3/20
to Discussion forum for Computational Thinking
In this , I got the value of P which is equal to C is approx 5 words and Q which is equal to B is approx 7 words
according to this we get the answer R =0 .
Can you please explain where I did mistake?

graded 3ct.JPG

Anand Iyer

unread,
Nov 3, 2020, 3:59:56 AM11/3/20
to Discussion forum for Computational Thinking, ajeetku...@gmail.com
We'll start with a few things we know.

B contains the average length of a word in the set.

C is the average length of a word in every line.

If we're in agreement until this, let's see the rest. 
 
A is initially zero before the procedure DoSomething is called the first time.

Every time you call DoSomething, A is assigned with what the function returns.

Now, let's tabulate the values of B, C, and A passed to the DoSomething procedure in the last loop.  



The last column in the above picture shows the condition under which the 1 gets added to A (R inside the procedure)

Hope things are clear now.  If not, please reply..

Anand Iyer

unread,
Nov 3, 2020, 4:01:03 AM11/3/20
to Discussion forum for Computational Thinking, Anand Iyer, ajeetku...@gmail.com
Attaching the picture again.
DoSomething.png
Reply all
Reply to author
Forward
0 new messages