Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved 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,

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

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

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

More Books

Students also viewed these Databases questions

Question

Explain the activity of the appetite hormones insulin and leptin.

Answered: 1 week ago

Question

Write the difference between sexual and asexual reproduction.

Answered: 1 week ago

Question

What your favourite topic in mathematics?

Answered: 1 week ago

Question

Briefly describe vegetative reproduction in plants.

Answered: 1 week ago

Question

General Purpose of Your Speech Analyzing Your Audience

Answered: 1 week ago

Question

Ethical Speaking: Taking Responsibility for Your Speech?

Answered: 1 week ago