subject
Computers and Technology, 03.07.2021 09:40 tttyson

Topics: New, Delete, Characters, Strings, C++ strings, C strings Cryptography— the science of secret writing — is an old science; the first recorded use was well before1900 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 KeyA|B|C|D|E|F|G|H|I|J|K|L|MN|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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
The word ‘play’ comes with many different interpretations and a variety of definitions. discuss some of the various meanings tied to the word play. why is the concept of play thought to be an important addition to the workplace? do some (brief) research online and give an example of how play in the workplace is being done right.
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
You know the right answer?
Topics: New, Delete, Characters, Strings, C++ strings, C strings Cryptography— the science of secre...
Questions
question
Arts, 18.12.2020 19:10
question
English, 18.12.2020 19:10
question
Health, 18.12.2020 19:10
Questions on the website: 13722363