- Solve the popular CS FizzBuzz problem
- Get familiar with Array's, ArrayList's, Loops, and Conditionals
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
ex output:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
We'll be slightly modifying FizzBuzz to build a more flexible program. The key difference is our FizzBuzz will take two arguments startNumber and endNumber, allowing for any range of numbers we wish. You should read the testSpec for more guidance on the edge cases your program should account for. For example: how your program deals with negative number or an invalid range.
View Android-FizzBuzz on Learn.co and start learning to code for free.