In JAVA please re-do the Magic8Ball program from BA5. The program should general
ID: 3705866 • Letter: I
Question
In JAVA please re-do the Magic8Ball program from BA5. The program should generally work the same as it did in BA5, but updated to include these items:
Create a method called get8BallAnswers (2 point)
The method should have no parameters
The method will build the array of possible String answers (from BA5), and return the entire array
Overload the get8BallAnswers method (2 points)
The method should have 1 integer parameter, where the user can pass a random number to it
The method should return 1 possible String answer from the array. Hint: You can use the method you created in step 2 to retrieve the array of answers.
Create a method called magic8Ball that will basically run the whole program. (2 point)
It should ask the user to enter a question for the 8 Ball, generate a random number, and pass that to one of the methods above to get a response.
You will call this magic8Ball method in the main method.
The method should be called within the do-while loop, and repeat if the user wants to run the program again or not.
The array should have these 12 reponsess
Yes, of course!
Without a doubt, yes.
You can count on it.
For sure!
Ask me later.
I'm not sure.
I can't tell you right now.
I'll tell you after my nap.
No way!
I don't think so.
Without a doubt, no.
The answer is clearly No.
Thank you very much!
Explanation / Answer
Hi Dear,
Please find my implementation.
Output:
Ask Question here : 5
Ans : Without a doubt, no.
Ask Question here : 7
Ans : I can't tell you right now.
Ask Question here : No questions
Process finished with exit code 0
Please DONT forgot to rate my answer. We are working hard for you Guys!!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.