June 2017
Beginner
320 pages
7h 37m
English
Now that you know if-statements, I’m going to give you some rules for for-loops and while-loops that will keep you out of trouble. I’m also going to give you some tips on debugging so that you can figure out problems with your program. Finally, you will design a little game similar to the last exercise but with a slight twist.
if-statements1. Every if-statement must have an else.
2. If this else should never run because it doesn’t make sense, then you must use a die function in the else that prints out an error message and dies, just like we did in the last exercise. This will find many errors.
3. Never nest if-statements more than two deep and always try to do them one deep.
4. Treat if-statements ...
Read now
Unlock full access