Question: Write a program in java where: Input: This will come from a text file. Student will create the messages. File will contain at a minimum

Write a program in java where:

Input: This will come from a text file. Student will create the messages.

File will contain at a minimum of 20 messages.

Messages shall contain status information about a topic you are familiar with, for example:

The alarm is set.

The alarm is disabled.

Check furnace emergency switch.

ProcessingPart1: Reading in the messages.

Read messages form the text file.

Parse the string and store each word into an array or arraylist.

Have other arrays that keep track of (1) The words posn in the array, (2) The # of words in a message, and (3) The posn of the words for each message.

Is part is finished when all messages have all of the words store into an array, with supporting indices stored in other arrays.

Part 2: Retrieving a message.

After messages are read in, ask use to enter the message number wish to retrieve.

Validate the number.

If valid, get the messages parts, put message together and display the message.

Look and ask for different messages until user is finished.

Output

After Part 1, display the array holding the messages, so we can see how the array were populated.

Display the message the user asked for.

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!