December 2018
Beginner to intermediate
472 pages
11h 16m
English
The hints below might help when you are stuck with one of the exercises in this book. They don’t give away the entire solution, but rather try to help you find it yourself.
You can start with a program that prints the numbers 1 to 7, which you can derive by making a few modifications to the even number printing example in “while and do Loops” on page 30, where the for loop was introduced.
Now consider the equivalence between numbers and strings of hash characters. You can go from 1 to 2 by adding 1 (+= 1). You can go from "#" to "##" by adding a character (+= "#"). Thus, your solution can closely follow the number-printing program.
Going over the numbers is clearly a looping ...
Read now
Unlock full access