Purchase Solution

Chiper code in C++

Not what you're looking for?

Ask Custom Question

You have TWO OPTIONS on how to send in this assignment (either way will get you the same credit):

[1] Either by HAND

e.g., WRITE OUT a little Table/Figure (use Excel Worksheet? MS Word "Table"? However you want to do it)
that will illustrate the 2 rows of Alphanumeric letters as follows (with OUT the "dots", of course. You'll have to fill
the alphanumeric characters:

Plaintext Letter: | abcdefghij...z ... ABCDEF ....Z 123456...0
------------------+------------------------------
Ciphertext Letter | gqkuiehjr... p ... VZRHPU ...T 869034...2

--- OR:

[2] Write a Program to do it. As far as a "random seed", you could get this accomplished by doing the following
(at least this is the way I would do it):
Let a random generator go from 1 to 26 for EACH SET of ALPHABET LETTERS (e.g., the CAPs and the
LOWERCASE LETTERS), and from "0" to "9" for all of the NUMBERS. and use the process of elimination to
let it GENERATE each RANDOM character.

o How would you know how to store the letters? Probably by having the original letters in an array/vector and use
their INDEXES as the NUMBERS GENERATED by the RANDOM GENERATOR.

(a) Have the random generator generate an "unused" letter, then STORE that letter into a global array/vector, etc.

(b) Then, use a "checking" method (that could possibly return a BOOL) to CHECK if the NEXT randomly generated
number has been used yet.

(c) If it HAS been used then let the random generator come up with ANOTHER number (until it generates an UNUSED NUMBER)

(d) If the number has NOT been used yet, then add that number to the NEXT INDEX of the array/vector us USED NUMBERS

(e) Do this in a LOOP until you have ALL of the 26 LETTERs ACCOUNTED FOR for each of the sets of ALPHA CHARACTERS,
and 1 through 10 (or 0 thru 9 if you are Zero-basing your indexes).

What Text to Decipher:
[1] If you're doing it by method [1] above (e.g., using a Word/Excel document: Decipher the words of the Declaration of Independence listed below:

IN CONGRESS, July 4, 1776.

The unanimous Declaration of the thirteen united States of America,
When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected
them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and
of Nature's God entitle them,

[2] If you're using method [2] from above, have your program decipher the whole Declaration of Independence.

Purchase this Solution

Solution Summary

The Chiper code in C++ are examined.

Solution Preview

Dear Student, please find attached the C++ source code. I have used C++ map class to store the map between an input character and randomly mapped cipher character. The map holds the mapping for all letters lowercase and upper case and digits. The logic is simple: check if mapping exists, if not create a random mapping checking if it is a digit or character. The program ...

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.