Question: In Java, Professor Potter has left a secret message, of unknown length, encoded in file msg.dat (posted on Canvas) for you to unravel. The setup

In Java, Professor Potter has left a secret message, of unknown length, encoded in file msg.dat (posted on Canvas) for you to unravel. The setup is simple: each line of the file contains one char and one nonnegative integer. The key to reading the message is organizing the characters in the proper order. The integer indicates the position of the character within the message. For example:

e 2

b 1

a 3

h 5

c 4

spells 'beach' when unraveled.

You will create and submit 2 classes:

MessageDecoder class:

  • Responsible for converting a scrambled message file into plain text.
  • Contains a public method getPlainTextMessage() that returns the String object.
  • The scrambled file must be scanned only once and must be scanned inside this class.
  • Must utilize the linked list data structure to accomplish the decoding work. (See Lab 4 & Lab 5) - referencing a link sorting function and remove duplicates function
  • Does not call any methods of SecretMessage class

SecretMessage class:

  • Contains the main() method
  • All of printing to console must be done in this class
  • All of user input from the keyboard must be performed in this class
  • Uses the public methods of your MessageDecoder class to accomplish the decoding.

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!