Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

it is duplicating the first part after i run throught it again. How do i get rid of it. I have tried doing if statements

it is duplicating the first part after i run throught it again. How do i get rid of it. I have tried doing if statements and does not work.

int checkKeyNumber(int checkKey, int checkThree) { int checkChange = -1; if(checkKey >= 1 || checkKey = 1 || checkKey 35) { cout

bool noSymbols(char checking) { if(checking-'0' >= 0 && checking-'0' = 0 && checking-'a' = 0 && checking-'A'

return false; }

void convertLowertoUpper(string &name) { for(int i = 0; i

//this is where we decrypt the message void decryptMessage(string name, int key) { string userInput(name); vector compareLetter(userInput.begin(), userInput.end());

vector > decrypt(36, vector(36));

decrypt[0][0] = 'A'; decrypt[0][1] = 'B'; decrypt[0][2] = 'C'; decrypt[0][3] = 'D'; decrypt[0][4] = 'E'; decrypt[0][5] = 'F'; decrypt[0][6] = 'G'; decrypt[0][7] = 'H'; decrypt[0][8] = 'I'; decrypt[0][9] = 'J'; decrypt[0][10] = 'K'; decrypt[0][11] = 'L'; decrypt[0][12] = 'M'; decrypt[0][13] = 'N'; decrypt[0][14] = 'O'; decrypt[0][15] = 'P'; decrypt[0][16] = 'Q'; decrypt[0][17] = 'R'; decrypt[0][18] = 'S'; decrypt[0][19] = 'T'; decrypt[0][20] = 'U'; decrypt[0][21] = 'V'; decrypt[0][22] = 'W'; decrypt[0][23] = 'X'; decrypt[0][24] = 'Y'; decrypt[0][25] = 'Z'; decrypt[0][26] = '1'; decrypt[0][27] = '2'; decrypt[0][28] = '3'; decrypt[0][29] = '4'; decrypt[0][30] = '5'; decrypt[0][31] = '6'; decrypt[0][32] = '7'; decrypt[0][33] = '8'; decrypt[0][34] = '9';

for (int i = 1; i

for (int j = 1; j

}

} string newPhrase;

for(int i = 0; i

cout

}

//This is where we encrypt the message void encryptMessage(string name, int key) {

string userInput(name); vector compareLetter(userInput.begin(), userInput.end());

vector > encrypt(36, vector(35));

encrypt[0][0] = 'A'; encrypt[0][1] = 'B'; encrypt[0][2] = 'C'; encrypt[0][3] = 'D'; encrypt[0][4] = 'E'; encrypt[0][5] = 'F'; encrypt[0][6] = 'G'; encrypt[0][7] = 'H'; encrypt[0][8] = 'I'; encrypt[0][9] = 'J'; encrypt[0][10] = 'K'; encrypt[0][11] = 'L'; encrypt[0][12] = 'M'; encrypt[0][13] = 'N'; encrypt[0][14] = 'O'; encrypt[0][15] = 'P'; encrypt[0][16] = 'Q'; encrypt[0][17] = 'R'; encrypt[0][18] = 'S'; encrypt[0][19] = 'T'; encrypt[0][20] = 'U'; encrypt[0][21] = 'V'; encrypt[0][22] = 'W'; encrypt[0][23] = 'X'; encrypt[0][24] = 'Y'; encrypt[0][25] = 'Z'; encrypt[0][26] = '1'; encrypt[0][27] = '2'; encrypt[0][28] = '3'; encrypt[0][29] = '4'; encrypt[0][30] = '5'; encrypt[0][31] = '6'; encrypt[0][32] = '7'; encrypt[0][33] = '8'; encrypt[0][34] = '9';

for (int i = 1; i

for (int j = 1; j

string newPhrase;

for(int i = 0; i

cout

}

int main() {

string tempChoice; string encryptOrDecrypt;

int checkOne = -1; int checkTwo = -1; int checkThree = -1; int exit = -1; int key; string name;

do { cout

cout

cout

if(encryptOrDecrypt == "EXIT" && checkOne == 0) { cout

if(encryptOrDecrypt == "ENCRYPT" || encryptOrDecrypt == "DECRYPT") { cout

} for(int i = 0; i > key; cout

if (encryptOrDecrypt == "DECRYPT" && checkOne == 0 && checkTwo == 0&& checkThree == 0) { decryptMessage(name, key); } else if (encryptOrDecrypt=="ENCRYPT" && checkOne==0 && checkTwo==0&& checkThree == 0) { encryptMessage(name, key); }

name = tempChoice; encryptOrDecrypt = tempChoice; checkOne = -1; checkTwo = -1; checkThree = -1;

} while(exit);

image text in transcribed

"C\Users rs_lulDownloads cryptography (1).exe" test Welcome to cryptography hat would you like to do? (encrypt, decrypt, exit)? Enter your choice: encrypt Enter your message: hello world hello world test Enter the key number (1-35) 34 your message: HELLO WORLD Your translated text is: FCJJM UMPJB test Welcome to cryptograph What would you like to do? (encrypt, decrypt, exit)? Enter your choice: test Welcome to cryptography What would you like to do? (encrypt, decrypt, exit)? Enter your choice: "C\Users rs_lulDownloads cryptography (1).exe" test Welcome to cryptography hat would you like to do? (encrypt, decrypt, exit)? Enter your choice: encrypt Enter your message: hello world hello world test Enter the key number (1-35) 34 your message: HELLO WORLD Your translated text is: FCJJM UMPJB test Welcome to cryptograph What would you like to do? (encrypt, decrypt, exit)? Enter your choice: test Welcome to cryptography What would you like to do? (encrypt, decrypt, exit)? Enter your choice

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