logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

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

expert
Ngozi EmeagwaliStatistics
(/5)

931 Answers

Hire Me
expert
Garima ThakurFinance
(5/5)

636 Answers

Hire Me
expert
Douglas RichardsPsychology
(5/5)

913 Answers

Hire Me
expert
Clifford BillmanBusiness
(5/5)

523 Answers

Hire Me
C++ Programming

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

                                                                              

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. 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

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme