logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

ROT13 is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

CIS 22B Lab 1   Simple Cryptography

Topics:  New, Delete, Characters, Strings, C++ strings, C strings

For all assignments in CIS 22B, use heading comments at the top with the following format:

 

/*

Fred Flintstone

Summer 2019

Lab 1

Problem 0.0.0

Description of problem:

a few lines describing input, activity, and output of the program

*/

Cryptography — the science of secret writing — is an old science; the first recorded use was well before

1900 B.C.  An Egyptian writer used previously unknown hieroglyphs in an inscription.

 

We will use a simple substitution cypher called rot13 to encode and decode our secret messages.

 

ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it, in the alphabet. ROT13 is a special case of the Caesar cipher which was developed in ancient Rome.

 

Decryption Key

A|B|C|D|E|F|G|H|I|J|K|L|M
-------------------------
N|O|P|Q|R|S|T|U|V|W|X|Y|Z

(letter above equals below, and vice versa)

As you can see, A becomes N, B becomes O and so on.

Your job is to write a program, with at least four functions, including main, which must do the following:

  1. Ask user whether they want to encode or decode a message – if no, then terminate
  2. Take the input string from the user, store it in dynamic memory (use new)
  3. As appropriate, encode or decode the message using Rot13.
  4. Output the encoded/decoded message
  5. Delete the input string from dynamic memory (use delete)

Input will be a string of no more than 25 characters.  Blanks get replaced with blanks.

Do not worry about punctuation; there will be no punctuation in the string.

ALPHABET becomes NYCUNORG

Test your program with the following strings:

TAF VF

 paddrpf

I’ll be using other strings to test your code.

Some suggestions (NOT requirements):

  1. C++ string library functions would be useful here
  2. You can process the C++ string one char at a time if you use the length member function

                                                                              

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

618 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

979 Answers

Hire Me
expert
Husnain SaeedComputer science

761 Answers

Hire Me
expert
Atharva PatilComputer science

784 Answers

Hire Me