In this problem, the program should calculate the number of digits in a given positive integer, in this case, 1240791. You can count the number of digits, 7, but your job is to make a program that can count the number of digits of any given positive integer.
Most of the program has been written for you, but it still needs a repeat while or repeat until block with a boolean expression. Add a repeat block and add the boolean expression that will produce the following output.
124079 12407 1240 124 12 1 0 The number of digits in the original integer is 7
Coding:
Hotkey Shortcuts
Move BlocksUP or DOWN or TAB
Run Program ALT + SHIFT + R
Stop Program ALT + SHIFT + S
Hide Tray ALT + SHIFT + X
Zoom In ALT + +
Zoom Out ALT + -
Open Help ALT + SHIFT + H
Navigate to Tray ALT + 1
Navigate to Blocks ALT + 2
Enter Navigation Mode SHIFT + ENTER
Blocks
Hint
Great job!
Try again
Choose a type of loop to add then replace the boolean value with an expression. Keep in mind there are many different answers to this problem. If you chose the repeat while loop, you could have used several boolean expressions like myInteger not= 0 or myInteger > 0. If you chose a repeat until loop, an expression like myInteger = 0. Then move the three blocks, myInteger = myInteger/10, output myInteger, and digitCount = digitCount + 1 into the loop scope.