Redo or do Practice Program Except write a class for the Magic 8 Ball.Write a program that simulates the Magic 8 Ball game. Upon running the program, generate a random number such that one of the following 8 responses is output:except write a class for the Magic 8 Ball. Write a program that simulates the Magic 8 Ball game. The class should have a method that returns an answer at random. Test your class by outputting the answer several times.
It is certainIt is decidedly soMost likelySigns point to yesReply hazy, try againAsk again laterDon’t count on itMy sources say no
There should be an equal chance for any one of the eight responses to come up. The program should ask the user if he or she would like to repeat the program and loop if the user opts to repeat. Random number generation is discussed in but for this program you can use the following line of code to generate a random number between 1 and 8: ;
int num = (int) (Math.random() * 8) + 1;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.