| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
- /**
- * Write a description of class fizzBuzz here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class fizzBuzz
- {
-
- /**
- * Constructor for objects of class fizzBuzz
- */
- public fizzBuzz()
- {
-
- }
-
- /**
- * An example of a method - replace this comment with your own
- *
- * @param y a sample parameter for a method
- * @return the sum of x and y
- */
- public String fizzBuzz(int y)
- {
- String result ="";
- if (y % 5 == 0 && y % 3 == 0){
- result = "fizzBuzz";
- }else if (y % 3 == 0){
- result = "fizz";
- }else if (y % 5 == 0){
- result = "buzz";
- }else{
-
-
- result = Integer.toString(y);
- }
-
- return result;
- }
-
- }
|