CyberStars

Recap: FizzBuzz

Combine if/else, if/else if, and for loops into a single challenge


Mission: Tape Reel Diagnostics

A diagnostic program checks 20 magnetic tape reels, numbered from 1 to 20, at a computing center. Each reel gets a label based on divisibility patterns set by the system administrator.

  1. Loop through numbers from 1 to 20
  2. If the number is divisible by both 3 and 5, print "X: fizzbuzz"
  3. If divisible by 3 only, print "X: fizz"
  4. If divisible by 5 only, print "X: buzz"
  5. Otherwise, print "X: normal"
  6. At the end, print how many fizzbuzz reels you found

Output

1: normal
2: normal
3: fizz
4: normal
5: buzz
6: fizz
7: normal
8: normal
9: fizz
10: buzz
11: normal
12: fizz
13: normal
14: normal
15: fizzbuzz
16: normal
17: normal
18: fizz
19: normal
20: buzz
FizzBuzz count: 1