Question: LANGUAGE IS JAVA The initial greeting should say Hello, my name is Eliza. What is your name? The user should enter their name. Then the

LANGUAGE IS JAVA

The initial greeting should say Hello, my name is Eliza. What is your name?

The user should enter their name.

Then the program should greet the user by name and prompt them for input related to the therapy session

"Hello . Tell me what is on your mind today in 1 sentence.

When the user submits their sentence your program should read in the line

It should use the 1st word and last word from that line to form another prompt to the user by plugging those words into a statement or question randomly selected from the relevant array.

Create methods that work with the starter code to replace BLANK1 and BLANK2 with the words from the line

If the sentence the user enters ends with a ?, the program should prompt the user with a question built using the 1st word and last word of their line.

If the sentence the user enters ends with a !, the program should prompt the user with a statement that starts with WOW! Dramatic! followed by the rest of the statement built using the 1st word and last word of their line.

If the sentence the user enters ends with a . or any other character, the program should prompt the user with a statement built using the 1st word and last word of their line.

This process should be repeated until the user types EXIT as a response

When the user types EXIT the user should be asked if they want to run the session again.

If they say yes, upper or lower case, run the program from the beginning

If they say no, upper or lower case, say Goodbye, until next time

Some of the things youll need to do to get the Project to work:

Initialize your arrays to the appropriate length.

Modify the existing methods in the starter code to populate the arrays by following the code comments

Create methods to replace BLANK1 and BLANK2 in the sentence trunk you got from the array

public class PromptBank { String [] questions; String [] statements; public PromptBank(){ //questions = new String[ ]; //initialize array to the correct length to match number of questions //statements = //initialize array to the correct length to match number of questions populated } public void populateStatementsArray(){ questions[0] = "Tell me more about BLANK1 and BLANK2"; questions[1] = "BLANK1 seems important to you, so does BLANK2. Please tell me more."; questions[2] = "BLANK1 and BLANK2 seem to be on your mind. Let's talk about it."; } public void populateQuestionsArray(){ questions[0] = "Is there anything else about BLANK1 and BLANK2?"; questions[1] = "Does BLANK1 bother you? How about BLANK2?"; questions[2] = "Are BLANK1 and BLANK2 things you think about often?"; 

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!