Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Requirements 1. Create an application that will generate a fortune (prediction) for the user. 2. The application will allow the user to input data.

JAVA

Requirements

1. Create an application that will generate a fortune (prediction) for the user. 2. The application will allow the user to input data. 3. The application will display a fortune based on the input data. 4. The application will validate the data. 5. The application will allow the user to generate another fortune without having to restart the program or allow the user to end the program. Menus

Menus 1-2 through 1-5 are displayed one question at a time.

------------------------------------------------------------------------------------------------------------- Welcome, I am FrogDini, the fortune telling amphibian. I can tell your future if you only answer a few questions. What type of fortune do you want? 1. Romance 2. Wealth 3. Health 4. Fame

Enter the selection number here: ------------------------------------------------------------------------------------------------------------- Figure 1-1: Top (Opening) Menu

------------------------------------------------------------------------------------------------------------- What city were you born in? What is the most romatic color? What is your favorite name? What is your job? Enter a letter? What is your favorite hobby? Enter a number? ------------------------------------------------------------------------------------------------------------- Figure 1-2: Romance Menu

------------------------------------------------------------------------------------------------------------- What city do you like best? What color is your mothers hair? What is your favorite teacher's first name? Name a high paying occupation? Enter your second favorite letter? What is your favorite hobby? Enter your fifth favorite number? ------------------------------------------------------------------------------------------------------------- Figure 1-3: Wealth Menu

------------------------------------------------------------------------------------------------------------- What city do you think has the most celebrities? What do you think is the most famous color? What do you think is the most common name? What job do you think makes people famous? Enter your least favorite letter? What do you think famous people do as a hobby? Enter your least favorite number? ------------------------------------------------------------------------------------------------------------- Figure 1-4: Fame Menu

------------------------------------------------------------------------------------------------------------- What do you think is the healthist city in the world? What is the color of your car? What is your doctor's first name? What do you think is the healthyist job? Enter your third favorite letter? What is your favorite hobbie? Enter your fifth favorite number? ------------------------------------------------------------------------------------------------------------- Figure 1-5: Health Menu

------------------------------------------------------------------------------------------------------------- [Display computed fortune] Do you want to continue? ------------------------------------------------------------------------------------------------------------- Figure 1-6: Fortune Menu

Data Storage

Data for the fortune teller application will be held in arrays. The data will not be held after the application is exited. The arrays are listed below:

Quotes this array holds the first half of the generated fortune. Answers this array holds the data input by the user

Methods and Variables

The methods that are included in this application are all defined in the same class. They are also all static methods and variables.

Methods: main() topMenu() romanceMenu() wealthMenu() fameMenu() healthMenu() romanceFortune() wealthFortune() fameFortune() healthFortune() fillInArray()

Variables choice - String answers ArrayList sc scanner Quotes ArrayList,String> t temporary String

Design

The application is designed to produce a fortune. The main() method handles the process flow. The pseudo code for that process flow is listed below:

1. Start program 2. Initialize loop variable 3. Begin loop 4. Display opening menu 5. Retrieve users answer about the type of fortune wanted. 6. Use if statement to determine which question menu to display 7. Retrieve the answers from the user 8. Finish filling in the answer array with a new number, letter, and name. 9. Use if statement to determine which fortune to displayed 10. After the fortune is displayed, clear the answer array 11. Ask the user if they want to continue. If yes, loop back to step 3 and continue. If no, exit the program.

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

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why do living creatures die? Can it be proved that they are reborn?

Answered: 1 week ago