Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 8 0 0 ICT Assignment Milestone This assignment requires you to solve problems and write software independently, and to integrate various aspects of C
ICT Assignment Milestone
This assignment requires you to solve problems and write software independently, and to
integrate various aspects of programming that you have learned this trimester. You must
write ALL the C program code. This program should maximize the use of objectoriented
programming.
Problem Description
Top secret agent Claude L Evers has a unique way to send encoded messages. The message
is implanted in a square grid of letters as follows: starting at the middle letter at the left
most side of the grid he writes the message along the diagonal heading to the top of the
grid. After he hits the top, he then continues the message on a diagonal heading right until
he hits the righthand side. He continues this way, tracing out a diamond until he reaches
the left side again. At this point he continues the message in the diamond nested inside the
diamond he just filled in and after this the next diamond inside, and so on Any leftover
squares both inside and outside the original diamond are filled with random letters.
The grids below show the steps in encoding the message ignoring the blank spaces:
GENERAL TSO NEEDS CHICKEN NOW
The first grid shows the encoding after the first diamond has been filled in The second, third
and fourth grids show successively smaller diamonds being filled in Finally, the last grid
shows the final message after random letters have been placed in the empty squares
around the grid.
Note that if the original message had not filled in the entire set of diamonds, then random
letters would have been used to fill those empty slots as well see Sample for an example
of this when encoding GENERAL TSO HATES CHICKEN To send the message, Evers
concatenates all the rows together, toptobottom. The above grid would be sent as
THEESEARENSRNTAEDNCACGEEWNHLTEKOITUALNCSLYRANODOM
Now, your task is to develop a program capable of both encoding and decoding any
message.
The encoded message consists of a single string of uppercase alphabetic letters. The length
of the encoded message will be a square of an odd integer. Note that the decoded
message might contain some random letters at the end if the original message did not fill
the entire set of diamonds. Some encoded and its decoded messages are like below:
Sample
Encoded: THEESEARENSRNTAEDNCACGEEWNHLTEKOITUALNCSLYRANODOM
Decoded: GENERALTSONEEDSCHICKENNOW
Sample
Encoded: WHAETHERENSRALLEENCAYGTELIHLKAKEITSARHCSEBIGMOACS
Decoded: GENERALTSOHATESCHICKENIEL
Sample
Encoded: JOMHNPARTAILUUHLASERINWGO
Requirements:
Your task is to develop an objectoriented C program with a textual user interface like
below. After running each option, the interface should display after its output.
This program can always continue, even if a user enters incorrect data, until the user
quit it This means that the system should be able to handle various exceptions that
may occur during execution.
For option and allow the user to enter a file name or use a default file name.
For option when developing the encoding scheme, provide two ways for setting
the size of the square grid:
o one is to allow the user to enter the grid size,
one is to let the program to decide a suitable size for the square grid. Note
that there may be multiple suitable sizes for the square grid.
For option your task is to implement the decoding scheme. Your program should
accurately decode the encoded messages provided in Sample through Sample
Produce a UML for each class used in your program. Each UML must clearly identify:
The name of the class
The name and data type of each member variable
For each member function
Its name
Its return data type
For each parameter: its name and data type
All member variables and functions should clearly show their visibility ie
privatepublicprotected#
Inheritance relationship if applicable
Be well written sensible variable names, indentation, no too long functions,
appropriate comments Submit:
all C source code: cpp and hpp if your code is organized into separate files.
weektxt: a txt file contains all the source code.
weekdocx or weekpdf this document should include:
UML for each class
Screenshot for running each option in the textual user interface, including normal and abnormal inputs. For example, the normal and abnormal inputs are like below:
table#option,Normal Input,Abnormal InputA message,Empty inputFile name,tableWrong file nametableAmessagetableGrid size by userEmpty message inputGrid size by program,Grid size by user but not a numberThe three samples,tableThe length of the encoded messageis not a square of an odd integer.File name,Empty inputDesired character,Not desired character
Please refer to the submission page for the Marking Rubric.
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