zlacker

[return to "My Favorite Programming Problem to Teach: Digit Length"]
1. Gunax+8A[view] [source] 2019-11-11 06:31:25
>>jstrie+(OP)
Are these the typical steps students go through? I would guess that most students know to convert it to a string and count the length, with a smaller group knowing about base 10 logs.

I like the general idea of it--improving the algorithm incrementally, finding exception cases, but I wonder if there is a better example that could be used.

It seems to me that one either knows how to use logarithms or not, and thus students would either skip to the final solution, or be stuck until having the answer given to them.

◧◩
2. jstrie+Ag1[view] [source] 2019-11-11 14:58:02
>>Gunax+8A
I was writing less about the steps students would go through when solving the problem on their own, and more about points I try to hit when using the problem to teach. At this point in the course, strings haven't been taught, so using them would not be a natural solution for those without prior programming experience. I will also review logarithms if necessary.
[go to top]