1234567891011121314151617181920212223242526272829303132 |
-
- /**
- * Write a description of class FizzBuzz1 here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzz1
- {
- public FizzBuzz1(){
-
- }
-
- public String Fizz(int num){
- String toReturn = Integer.toString(num);
-
- if (3 % num == 0){
- toReturn = "Fizz";
-
- } else if(5 % num == 0) {
- toReturn = "Buzz";
-
- } else if(num % 15 == 0){
- toReturn = "FizzBuzz";
- }
-
-
-
- return toReturn;
- }
- }
|