/FizzBuzz-assignment

FizzBuzz assignment for the Software Development Methods course

Primary LanguageJava

FizzBuzz assignment

We want to write a Java program that prints the numbers from 1 to 100 to the "standard" output stream and follows these rules.

  • For multiples of 3 it prints Fizz instead of the number.
  • For multiples of 5 it prints Buzz instead of the number.
  • For numbers which are multiples of both 3 and 5 it prints FizzBuzz.

Extended version

We want our Java program to print numbers from 1 to 105 and apply these additional rules.

  • For multiples of 7 it prints Bang instead of the number.
  • For numbers which are multiples of both 3 and 7 it prints FizzBang.
  • For numbers which are multiples of both 5 and 7 it prints BuzzBang.
  • For numbers which are multiples of 3, 5 and 7 it prints FizzBuzzBang.

Notes

  • This assignment is a variant of the Fizz Buzz Test.
  • Feel free to change the existing code.

Tests

  • Conversion from number to string (Convert)