In part f, why do we still count when the word length > 10?
Not exactly sure what you mean by, "count". If you mean go through the loop, then the answer is that if does not go through the loop when word length > 10.
I did. So the word "bbbbabbbb", the word length is 9 and the count is up to 4. I thought it should end there but i keep continue "bbbbbabbbbb", which the word length is 11 and it still count up to 5.
I think you are forgetting about the first time it goes through the loop when the word is "a"
When the word length is 9, it has gone through the loop 5 times.
But if count "a" = 1, then should it loop 6 times because it still count the last word "bbbbbabbbbb"?
No, it will not go through the loop when the word is, "bbbbbabbbbb"?
But as I review the slide from the class, the example number <50, the output is number 80. So it still goes through do while loop ?
Yes, the OUTPUT is 80, just like in the program the WORD would be, "bbbbbabbbbb" but the number of time that it goes through the loop is 5 in Practice.It. As soon as the while loop is false, the loop stops.
oh I got it. Thank you.