![]() | Physics and Astronomy |
Back to top
On this page
Contents Exercise: if()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. Extend error checking for the complex root codeNow 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. Fizz buzzThe 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. |