Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming In this assignment you will write a program that encrypts a text file. You will use the following encryption scheme. Ask the user

C++ Programming

In this assignment you will write a program that encrypts a text file. You will use the following encryption scheme.

Ask the user for the name of the original file.

Ask the user for the name of the output file.

Ask the user for the encryption key, n.

Read n2 characters from the file into the n rows and n columns of a 2-dimensional array.

Transpose the array. (Exchange the rows and columns.)

Write the characters from the array to an output file.

Repeat steps 4 6 until the input file has been read.

This same program can be used to decrypt a file that has been encrypted in this way.

Your program should have functions for performing the following tasks.

1) Reading the characters from the file into the array. This function should be passed the file stream, the array and the key.

2)Transposing the array. This function should be passed the array and the key.

3) Writing the characters from the array to the file. This function should be passed the file stream, the array and the key.

Your program should get the filenames, open the files and close the files in main.

Your program should also:

Give detailed directions and warnings to the user.

Be readable with appropriate documentation and formatting. (Be sure to include carefully written pre and post conditions for each of your functions.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions