Question: Fortune Teller Application Introduction This program is a Fortune Teller Application that will take input from a user, process that input, and display a fortune
Fortune Teller Application
Introduction
This program is a Fortune Teller Application that will take input from a user, process that input, and display a fortune tailored to the user. This proposal is divided into the following parts:
Requirements
Menus
Data Storage
Methods
Design
Requirements
Create an application that will generate a fortune (prediction) for the user.
The application will allow the user to input data.
The application will display a fortune based on the input data.
The application will validate the data.
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:
Start program
Initialize loop variable
Begin loop
Display opening menu
Retrieve users answer about the type of fortune wanted.
Use if statement to determine which question menu to display
Retrieve the answers from the user
Finish filling in the answer array with a new number, letter, and name.
Use if statement to determine which fortune to displayed
After the fortune is displayed, clear the answer array
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
Get step-by-step solutions from verified subject matter experts
