Question: java programming Create a program named Magic8Ball In the main method, create a loop that continually asks the user to type a question. If the

java programming
Create a program named Magic8Ball In the main method, create a loop that continually asks the user to type a question. If the user enters a blank question ("), exit the loop. Otherwise, call a method named getAnswer which returns a String containing the answer to the user's question. Print that answer and prompt for another question. In the getAnswer method, generate a random integer in the range of 1 to 10. Using if statements, return one of ten possible answers corresponding to the random number. You can make the answer text. Sample user entered value 8 SAMPLE OUTPUT: $ java Magic8Bal.1 I AM THE MAGIC 8 BALL Ask me a question about your future: What is the meaning of life? Cannot predict now Ask me a question about your future: Will I have great riches? Concentrate and ask again Ask me a question about your future: Will I become wealthy? Outlook not so good Ask me a question about your future
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
