Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Intro to Java Lab 6: Magic 8 Ball Background The Magic 8 Ball is a very popular fortune-telling toy from the 1950s. Users would ask

image text in transcribedimage text in transcribed

Intro to Java Lab 6: Magic 8 Ball Background The Magic 8 Ball is a very popular fortune-telling toy from the 1950s. Users would ask the all-seeing ball a yeso question and give it a shake. The ball contained dark liquid with a die suspended inside. The die had different answers printed on each side, so after the shake, the ball would give you an 'answer'. SIGNS POINT TO YES Exercise Your job is to complete the Lab6.java file. Do not touch the main method. You will instead create your own method, called getAnswer().getAnswer() should be spelled exactly as it is here. It should take in no arguments and should return a String--one of the outcomes listed below. The main method calls getAnswer(), and the grader will specifically check that you have a method called "getAnswer()"! You need to use Random to randomly generate an index value to select one of the 12 following strings: o It is decidedly so. o Yes - definitely. o Outlook good. o Signs point to yes. o Most likely. o Yes. Reply hazy, try again. O Cannot predict now. o Concentrate and ask again. O Don't count on it. o Concentrate and ask again. O Don't count on it. o My reply is no. o My sources say no. stephen anthony ellis@cloudshell:-/code/lab6$ java Lab6 Welcome to Magic 8 Ball! Ask me a yes or no question: Will the Steelers ever win another Super Bowl? Yes. Would you like to ask another question? yes Ask me a yes or no question: Are you randomly generating these answers? Reply hazy, try again. Would you like to ask another question? yes Ask me a yes or no question: Are you randomly generating these answers? Yes. Would you like to ask another question? no goodbye! stephen_anthony_ellis@cloudshell:-/code/lab6$

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago