Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arrays Programming Problems Part 1: Fortune Teller Write a program that functions as a 'fortune teller' application, Essentially, it should read in questions from the

image text in transcribed
Arrays Programming Problems Part 1: Fortune Teller Write a program that functions as a 'fortune teller' application, Essentially, it should read in questions from the user and respond to the questions using vague, aphoristic phrases that will fit almost any situation. You know, kind of like a Magic 8 Ball or the very Fortune Sticks I use to make all my important life decisions. When a user asks a question, use a random number to decide which index to draw your fortune from. Example output (get creative and make up your own fortunes, mine are nothing special): Welcome to the All-Knowing, All-Seeing Java Fortune Teller What is your question?' > Should I give a test this week? It is an auspicious time for such plans. Go forth with the confidence of the farmer who knows when the season is right. Do you have another question? > Should I give a quis the first week back from break? The future is cloudy and unclear- ask again at a later time. There is something blocking my ability to read this outcome; perhaps it is better to tread carefully, like the ancient fox in the woll's woods. Do you have another question? > No The best way to handle user input in this problem is to use a while loop that is controlled by what the user has typed in. For example, it could look like this: System.out.println("What is your question?") String input - scan.nextLine(); while (linput.equals("NO")) Ildo the random fortune telling W etc etc System.out.println("Do you have another question?") input-scan.nextLine(); Essentially, you read in the input while the input isn't equal to "No

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago