Implement a simple shuffle-encryption program

Assignment Help Computer Engineering
Reference no: EM132118959

Implement a simple shuffle-encryption program. This program will change the contents of a user-selected file so that pairs of characters are exchanged (making the file fairly difficult to read). If the program is used to re-process an encrypted file, the file should end up readable again, since all character pairs will be exchanged back into their original positions.

In order to "change" the contents of a file, your program will need to read the file's contents into an array of strings, close the input stream, modify the contents of the strings in the array, then open the file again for output and write the new strings into the file (this will erase the file's prior contents).

If the file has too many lines to fit in your array, abort the process - do not destroy the file by writing out only part of it.

Recall that I mentioned in class that strings contain arrays and size variables. They "behave" like arrays in that you can use subscripting/indexing (the [] operator) on strings to access and change individual characters in the string. You can find out the size (number of characters) in a string by calling its size method (a function owned by the string, like cin's ignore method).

For example, if I wanted to print the contents of a string backwards, I could use:

for ( int i = myString.size()-1 ; i >= 0 ; i-- ) cout << myString[i];

You can test your program on any file containing text. You might recall that, in a class example, I read the contents of one of the program source files. Since your program will be changing the file contents, this would not be a good idea, just in case something goes wrong. Use some other text file (I made a copy of one of the program's source files to use for testing...).

The executable program Gold10.exe demonstrates what your program should do. It has an array size limit of 50, if you want to try that aspect.

I am sorry that there is no option to attach a file. That's why I can't attach the Gold10.exe file. I have never seen this type of tough problem as it is my first programming course. I really need help to complete it. Thanks in advance.

Reference no: EM132118959

Questions Cloud

What are some security concerns when using mobile code : Explain the following terms: boot sector virus, meme virus, stealth virus, multipartite, macro virus, script virus, and tunneling virus.
Define encapsulation and abstraction and polymorphism : What is object oriented programming and what benefits does it provide. Define encapsulation, abstraction and polymorphism.
How many bytes of memory is this : Suppose you discover that RAM addresses 000C0000 to 000C7FFF are reserved for a PC's video adapter. How many bytes of memory is this?
What effect will seamuss death have on the partnership : HI6027 BUSINESS & CORPORATIONS LAW - Explain what type of company you would apply to register with ASIC, how that company would be categorised
Implement a simple shuffle-encryption program : Implement a simple shuffle-encryption program. This program will change the contents of a user-selected file so that pairs of characters are exchanged.
Evolution of cyanobacteria and autotrophs : Predict how that might have affected the changes in the atmosphere and the evolution of cyanobacteria and other autotrophs. Explain your answer.
How is a canary used to prevent stack smashing attacks : How is a canary used to prevent stack smashing attacks? How was Microsoft's implementation of this technique, the/GS compiler option, flawed?
Make a math model and the hash function implementation : Make a math model and the hash function implementation to automata system with a walking bomb and a walking robot.
Transport of materials across call membranes : Contrast the physical processes of simple diffusion and osmosis with the carrier mediated transport of materials across call membranes.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd