Write a program in which you set up a douhly-subscripted


Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

522_Assignment.png

A secret (shhh!): the keyword is PARKING

Have your program read in a message from the text Ilk you will find in Blackboard (please do riot reitamt, thy file), and store its letters with no spaces or punctuation, in a singlyssubscripted array. Then have your plovion use the keyword to encrypt the message and show the encrypted message on the screen. liert is how the encryption works using pencil and paper: Above the letters of the plain text illeSsage, write the lc tern tht: keyWOrd, repeating as much as necessary, For example lithe message is: meet me at midnights you would
write:

1845_Assignmnet1.png

Then look ibr the row in the table that begins with P and find the column headed NI. Use the corresponding letter in the body of the table, which is B. This is the first letter of the encrypted message. Continuing. for the next letter, find the row in the table that begins with . and the column that is headed F. and the body of the table happens to give E. For the next letter, the row beginning with R and the column headed F giN es a your encrypted message starts BEV.... {Notice that frequency-of-occurrence cannot he used to break this code.)

Follow these specifications:

In main, set up an array to hold the 7 characters of the keyword. In this program. do not make an array that stores the keyword repetitively. That would be inefficient. Instead, you can manipulate subscripts.

Declare all your array variables in the main program. Assume the message you Nvill encode has 100 characters or fewer.

In main. open a file for input, and include a trap to make sure it opened correctly.

Call a function to read in the original message and store it in an array. Skip spaces and punctuation. Make your program general enough so it can be run with a different input file that has a different-length message.

Back in the main program. print out the number that says how many characters are stored.

Call a function to set up and store the 2-dimensional Vigenere Table.

Back in the main program. print out the numbers that say how many rows and how many columns were used. Call a function to do the encoding.

Back in the main program. print out to the screen the original message (without spaces or punctuation), and on the line below it, print out to the screen the encrypted message.

Make sure there aren't any extra characters or missing characters.

Check at least some of the results by hand.

Run the program again with the other file's input data, and check the results.
p
lA
A recommendation: to facilitate checking, try your program first with an input file containing just a short phrase - for example

THE MESSAGE.

For the Detailed Plan: The specifications above give a rough starting outline. In your Plan, decide on variable names, types of variables. and in particular, how information from main will be passed down into the functions, and how information from the functions will be passed back to main. Use generic names for the arguments in the functions, that is, different names from what you use in main. You also need to plan in detail what steps need to be carried out inside each function. Your Plan is not to be C++ code.

Before you hand in the (neatly) hand-written Plan, please make a copy for yourself, so you can start %Norking on writing the C--f-+ code.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program in which you set up a douhly-subscripted
Reference No:- TGS0665088

Now Priced at $70 (50% Discount)

Recommended (96%)

Rated (4.8/5)