Question: JAVA: In this task you should implement the so-called fizz-buzz game that the computer should play. The game involves counting up from one; Each number
JAVA: In this task you should implement the so-called fizz-buzz game that the computer should play. The game involves counting up from one; Each number that is divisible by three is replaced by "Fizz" and each number that is divisible by five is replaced by "Buzz". A number that is divisible by five and three (e.g. 15) is to be replaced by "Fizz-Buzz". First read in the number n to which the computer should count as a command line parameter. You must not use loops, you must solve the problem recursively. Note, however, that counting should continue from 1. Don't create an array this time either, just output the numbers and strings directly. Note: The call java FizzBuzz 20 should finally be 1,2,Fizz,4,Buzz,Fizz,7,8,Fizz,Buzz,11,Fizz,13,14,FizzBuzz,16,17,Fizz, 19,Buzz.
Attention: An iterative solution without recursion gives 0 points!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
