Question: Artificial Intelligence elements in programming. Please write a program in Java with these requirement below. Ask a series of questions and based on the answer,

Artificial Intelligence elements in programming. Please write a program in Java with these requirement below.

Ask a series of questions and based on the answer, create an adventure or story.

_Welcome the use and let them know what is about to happen.

_Use JOptionPane for input and output.

_Use String.format() for the output.

_Ask the user a series of questions. 10-15 questions with each answer being able to generate 1-3 sentences will build a nice size story.

_Build a story for that user to read.

_The story should be different based on the answers For example if the computer asks "How are you today?" the story takes a different turn for "Happy" that it would for "SAD"

_Allow the user to do the story again without leaving the program. They should get different results with different answers.

_Look at giving one or two answers with randomized results. (the same answer gets a different result)

_Print the story for the user to see.

_When they are ready to leave, thank the user for using the program.

The learning goal for this exercise is to use switch statements and loops to create a user input generated story.

_Use at least one loop and three switch statements. You will likely need more. Some decisions can be satisfied with IF statements.

_Use appropriate levels of comments and indentions.

_Use the javac command to compile your code.

_Use the java command to evaluate the results of your code.

_Go beyond modifying your code to do something fresh. For example, validate user input. Or add some randomness to your story, (same input generates some different outputs)

_Code needs at least one loop and 3 switch statements!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!