Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C++ that will prompt the user to input a string of characters and prints an encrypted message back to the user

Write a program in C++ that will prompt the user to input a string of characters and prints an encrypted message back to the user as a string of ascii value base 2 , or it could be the other way round, promt the user to input an ASCII value in base 2 which then prints the decrypted string of character backs to the user. Here is an example: Do you want to encrypt or decrypt a message: encrypt Enter the string to encrypt: pet 01110000 01100101 01110100 Repeat again ? (y or n)? y Do you want to encrypt or decrypt a message: decrypt Enter the string to encrypt: 01110000 01100101 01110100 pet Repeat again ? (y or n)? y If the user wishes to input a string of text e.g hello world, it must be able to successfully decrypt it. Print an error message when: The encrypted message (binary) cannot be separated into bytes The encrypted message (binary) isnt 1s and 0s Not using the extended ASCII chart (128-255). Make sure the binary numbers will produce characters within 0-127. After error message keep prompting using to enter correct binary number. Creat using this 4 function: 1: Create a bin_to_ascii() function that takes a string of 1s and 0s as input and prints/returns the binary string as an ascii character. 2: Create a ascii_to_bin() function that takes an ascii character as input and print/returns the character as a binary value. 3: Create a get_user_inpu() function that gets the input from the user. 4: Create a check_bin_number() function checks that the user entered a binary number meeting the three requirements specified above. No global variables are allowed in this case. No using of arrays

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions