You may make a copy of a worksheet and complete this activity, or simply type your answers in any text editor.
You may work alone or with at most two other students in this course.
Consider the following Java method
public static List<String> fizzBuzz(int n)
{
var answer = new ArrayList();
for (int i = 1; i <= n; i++)
{
if (i % 2 == 0 && i % 3 == 0)
answer.add("FizzBuzz");
else if (i % 2 == 0)
answer.add("Fizz");
else if (i % 3 == 0)
answer.add("Buzz");
else
answer.add(Integer.toString(i));
}
return answer;
}
| DU-pairs | DU-paths |
| Test requirements | Test paths | Test cases (input values and expected output) |
| Test requirements | Test paths | Test cases (input values and expected output) |
| Test requirements | Test paths | Test cases (input values and expected output) |
(-2.5 points) for 24 hours late (submitted after 16-Oct-2025 11am EST, by 17-Oct-2025 11am EST)
(-5 points) for 48 hours late (submitted after 17-Oct-2025 11am EST, by 18-Oct-2025 11am EST)
Making your submission available to instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.
CC-BY-NC-SA 4.0 license.