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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started