Rules to follow:
- Words containing no more than 3 characters do not need to be encrypted.
- Do not encrypt the first and last characters, so scrambling can become Srbmnacilg or Srbmnailcg or Snmbracilg , that is, letters other than the first and last can encrypt in any order.
- The punctuation at the end of a word to be kept as is, that is, “Amazing” may become “Spsirnirug” but not “Spsirn, irug”.
- The following punctuation marks must be supported — Semicolon, Semicolon, Semicolon, Exclamation point.
- Do this for the file and save the sequence of lines.
When the program starts, it should prompt the user for a name input file and generate ciphertext output file. The output file must be named by appending the word "Scrambled" to the input file name.
Input: MyFile. txt -" Scrambling words is very interesting. Because even if they are scrambled, it doesn’t impact our reading. Because we don’t read letter by letter, we read the word as a whole. Output: MyFileScrambled.txt -" Srbmnacilg wrods is vrey itrensientg. Bscauee even if tehy are srelabcmd, it dosn’et ipcmat our raidneg. Bacusee we dn’ot raed lteetr by letetr, we raed the wrod as a wolhe.
Below is the implementation:
Smcinrablg wodrs very Bauscee eevn tehy dnoes’t icpamt Bcuesae d’not read lteter raed wrod whole.