|Physics and Astronomy|
Back to top
On this page
Exercises form an important part of your learning but are not formally assessed as a part of your course mark. Bring them to a demonstrator next week for feedback.
Now that we know how to use the if() statement, extend your previous complex root code:
You may either take a copy of your previous project or just extend the original.
The game of Fizz buzz involvs a group of children counting 1, 2, 3 etc except that if a number is divisible by three the person says "Fizz" instead of that number, and if it is divisible by five they say "Buzz". If it is divisible by both three and five they say "FizzBuzz".
NB: the exercise for the switch() statement is deferred to next week for timing reasons.