Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lang: C++ Need help starting/outlining code: Problem: You will write a program that asks the user for a string of characters and prints the encrypted

Lang: C++

Need help starting/outlining code:

Problem:

You will write a program that asks the user for a string of characters and prints the encrypted message back to the user as a string of ASCII values in base 2 OR asks the user for a string of ASCII values in base 2 and prints the decrypted string of characters corresponding to those values back to the user. This program will use functions for converting numbers, getting input from the user, converting input from the user, and error checking. Ask the user if they want to encrypt a message entered as string of text or decrypt a message given as a string of ASCII characters in base 2. If the user wants to encrypt a message of text, then read a line of text that can include spaces, e.g. jen or jen mocello. o Print the users encrypted message back to the user in binary. If the user wants to decrypt a message of characters in binary, then read a string of 1s and 0s from the user. o Print the decrypted message in corresponding text. Continue to prompt the user for encrypting or decrypting until the user doesnt want to do this anymore. Print an error message when: The encrypted message (binary) cannot be separated into bytes The encrypted message (binary) isnt 1s and 0s Since our messages are in English, we are not using the extended ASCII chart (128-255). Make sure the binary numbers will produce characters within 0-127. Recover from the error by re-prompting the user for a new binary number after their error, until they give a good binary number. Example: Do you want to encrypt or decrypt a message: encrypt Enter the string to encrypt: jen 011010100110010101101110 Do you want to play again (yes or no)? yes Do you want to encrypt or decrypt a message: decrypt Enter the string to encrypt: 011010100110010101101110 jen Do you want to play again (yes or no)? no

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions