Skip to content

Instantly share code, notes, and snippets.

@lynnlangit
Created October 14, 2014 02:55
Show Gist options
  • Save lynnlangit/64e4e572df799abee86e to your computer and use it in GitHub Desktop.
Save lynnlangit/64e4e572df799abee86e to your computer and use it in GitHub Desktop.
TKP Java FizzBuzz Solution
package org.teachingkidsprogramming.sectionLYNNtdd;
import org.teachingextensions.utils.VirtualProctor;
public class FizzBuzz
{
public static String convert(int i)
{
VirtualProctor.setName("LynnLangit");
if (0 == i % 15) { return "FizzBuzz"; }
if (0 == i % 5) { return "Buzz"; }
if (0 == i % 3) { return "Fizz"; }
return "" + i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment