Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

and click the 'Finish' button. In the Magic8Ball ma in () method body, write a program that simulates the popular children's decision-making toy called the

image text in transcribed
and click the 'Finish' button. In the Magic8Ball ma in () method body, write a program that simulates the popular children's decision-making toy called the Magic 8 Ball. To do this, the program will first have to prompt the user to enter his or her question. The user's response should be "stored" in a String-type variable named question. Use the nextLine () method on your Scanner-type object to obtain the entire line of text entered by the user. Once the program has read the entire line of text entered by the user, the program should generate a random number between 0 and 19 , which represents the 20 responses which are possible for a Magic 8 Ball: - It is certain - Reply hazy try again - It is decidedly so - Ask again later - Without a doubt - Better not tell you now - Yes definitely - Cannot predict now - You may rely on it - Concentrate and ask again - As I see it, yes - Don't count on it - Most likely - My reply is no - Outiook good My sources say no - Yes - Outlook not so good - Signs point to yes Very doubtful The program must generate this random number using the Math. xandom () method and should "store" the number in an int-type variable named randomNumber. The program should then use a selection (either nested if or switch structure) to Page 3 of 4

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_2

Step: 3

blur-text-image_3

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

How does global carrier selection differ from mode selection?

Answered: 1 week ago

Question

c. Will leaders rotate periodically?

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago