Performs encryption

Assignment Help Basic Computer Science
Reference no: EM13671195

A file filter reads an input file, transforms it in some way, and writes the results to an output file. Write a file filter class that
defines a function for transforming a character. This function should open the input and output files. It should read and
modify each character, writing the modified character to the output file. After all characters have been read and filtered you
should properly close both files. Then create a subclass for each of these transformations:

1. creates an unchanged copy of the original file (to test your inheritance)
2. performs encryption
3. transforms a file to all uppercase
4. modify #2 output to be all uppercase and in 5 letter groups
The base class should have a virtual member function

void doFilter(ifstream &in, ofstream &out)

that is called to perform the actual filtering. The virtual member function for transforming a single character should have the
prototype

char transform(char ch)

The encryption class should have a constructor that takes an integer as an argument and uses it as the encryption key. Add
the key to the character, take the result modulus 26 and write it to the output file.

NOTES: 1- Part one includes creating the base class. Please do it first! Save a copy. Then work on the others in order. As
you get the new subclass working save a copy with a different name. This way you will not lose partial credit.

2- Part 4 is a combination of #2 and #3. Start it only after you have finished the other parts and safely put them in a
different file. Ciphertext (non-computerized systems) typically is written in 5 letter blocks using all capital letters.
Remember to remove blank characters and to insert a blank every 5 characters. What do you do with new line characters?

Part 4 example. Input: IBM is a big company. Shift 25. HAL hr z ahf bnlozmx. Uppercase: HAL HR Z AHF
BNLOZMX. Strip spaces: HALHRZAHFBNLOZMX 5 letter groups: HALHR ZAHFB NLOZM X Remember to do it
character by character. Don't copy space characters. Count to 5 to output a space.

TRIVIA: This is where HAL from 2001 A Space Odyssey came from.

Reference no: EM13671195

Questions Cloud

Explain what the empirical simplest formula of the compound : A .3120g sample of a compound made up of aluminum and chlorine yields 1.006g of AgCl when mixed with enoughAgNO3 to react completely with all of the cholrtine. Explain what the empirical simplest formula of the compound is.
Explain what the percentage of calcium is in ionic compound : Explain what the percentage of calcium is in an ionic compound of unknown composition if a 2.241g Sample of the compound is completely dissolved in water and produces 1.252g of CaCO3 upon addition of an excess of Na2CO3 solution.
Given the outputs of the preorder and inorder traversals : Given the outputs of the preorder and inorder traversals
Explain which of the compounds have just bonding pairs : Explain which of the compounds have just bonding pairs of electrons as well as around the central atom. Explain which have a single nonbonding pair of electrons around the central atom
Performs encryption : Performs encryption
State lewis formulas for the shape tell whether it is polar : State Lewis (dot) formulas for the following and indicate their shape whether it is linear, trigonal, pyramidal, bent, or tetrahedral and to tell whether it is polar.
What is the maximum time it will take : In a box model, the maximum distance to transport particle across a city is shown as D. If the approximate length of one side is 40 miles, width is 28 miles and the mixing height is 2miles, to the nearest mile what will be this distance?
Explain what quantity of heat energy : A 25.0 g piece of aluminum is dropped into a beaker of water. The temperature of the aluminum drops from 94 degrees C to 67 degress C. Explain what quantity of heat energy did the piece of aluminum give off
Compute the molar mass of beta carotene of a solution : Compute the molar mass of beta carotene if 10.0ml of a solution containing 7.68mg of beta carotene has an osmotic pressure of 26.57mmHg at 25.0C.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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