Physics and Astronomy |
Back to top
Quiz: if() .. elseExperience shows that many students avoid getting to grips with these statements. The areas that often cause confusion are:
This quiz is designed to help with this: it generates and runs random collections of if() statements each enclosing a single printf() and asks you to indicate which will execute. After you have submitted your answer(s) you are given the chance to step through the code. In addition this version is configured so that after the program has been stepped through code that has been executed is highlighted in bold red and unexecuted code left black. You should be able to work out which parts have been left unexecuted and why. Try to do the quiz as a pairYou may well find it useful to first do the straight quiz as a pair and then go on to one of the games when you are feeling a little more confident.
|