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

  Imagine you are an entrepreneur starting a new business

1. assess the challenges e-business and e-commerce technologies present to the field of information technology.

  What is the asymptotic time complexity of algorithm

Suppose an algorithm has two parts. The first part involves sorting and takes (10 nlog n) steps, where n is the input size. What is the asymptotic time complexity of the overall algorithm, in Big Theta notation?

  The sport of gymnastics requires both impressive

The sport of gymnastics requires both impressive physical strength and extensive training for balance. The iron cross is an exercise performed on two suspended rings

  Which is a two-dimensional array of integers

You are to create a CourseGrades application that simulates a grade book for a class with six students that each has 5 test scores. The CourseGrades application should use a GradeBook class that has a member variables grades.

  Using a truth table or equivalent determine following

Using a Truth Table or equivalent determine

  Describe significance of having test coupled with real users

Describe the significance of having test coupled with real users' views of product at the end of development effort,even if it is test of a prototype and not the completely developed software.

  Provide an explanation of hashtables

In your comparison, be sure to include an explanation of one way hashtables are similar to your selected data structure and one way in which they are different.

  How the game is played from start to finish

Conduct outside research on the game Yahtzee. You really want to better understand how the game is played and scored. Then, create a 1-2 page paper that explains the following in essay form:

  How verbal and nonverbal communication affect communication

Write 1,750- to 2,100-word paper explaining how verbal and nonverbal communication can affect communication in given areas: Police situations (public announcement to the press).

  Write a java program using array or array list

Write a java program using Array or Array list and Use Methods.

  Discuss why the user needs are important

Discuss why the User Needs are important or stood out to you. Cite specific examples from readings. Include personal experience with the topic if appropriate.

  Define a simple interface named motorized

Given the interface defined in question 5, if a class named Motorcycle implements this interface, explain why the following code is legal. What happens when the interface reference vehicle invokes the maxSpeed method?

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