Question: Lang c++ my code:(has alot of errors need help with algorthim, set up and dealing with bad inputs): #include #include #include #include #include using namespace

 Lang c++ my code:(has alot of errors need help with algorthim,

set up and dealing with bad inputs): #include #include #include #include #include

Lang c++

my code:(has alot of errors need help with algorthim, set up and dealing with bad inputs):

#include

#include

#include

#include

#include

using namespace std;

void get_user_input(int User_Input);

string grab_user();

int String_to_binary(string my_string);

void Printthings(string str);

int main() {

int User_Input;

string my_string;

cout

cin >> User_Input;

my_string = grab_user();

get_user_input(User_Input);

system("pause");

return 0;

}

int String_to_binary(string my_string) {

// function that takes a string of 1s and zeros as input and prints/returns binary string as ascii character

for (int i = 0; i

cout (my_string[i]);

return 0;

}

string grab_user() {

string my_string;

cout

getline(cin, my_string);

return my_string;

}

void Binary_to_String (string str){

// function that takes an ascii character as input and print/returns the characer as binary value

cout

}

void get_user_input(int User_Input){

// function that gets the input from the user

string str;

while (true) {

if (User_Input == 1){

cout

grab_user();

String_to_binary(str);

Printthings(str);

break;

}

else if (User_Input == 2){

cout

Binary_to_String(str);

break;

}

}

}

void Printthings(string str){

int myvalue = String_to_binary(str);

cout

}

(60 pts) Problem Statement: 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 ASCll values in base 2 and prints the decrypted string of characters corresponding to those values back to the user. This 9 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 ASClI characters in base 2 If the user wants to encrypt a message of text, then read a line of text that can include spaces, eg. "jen" or "jen mocello" o Print the user's 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 Os from the user o Print the decrypted message in corresponding text. Continue to prompt the user for encrypting or decrypting until the user doesn't want to do this anymore. Print an error message when: The encrypted message (binary) cannot be separated into bytes .The encrypted message (binary) isn't 1s and Os . Since our messages are in English, we are not using the extended ASCII chart (128-255). Make sure the binary number's 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!