English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i only have one minor and one more than minor problem left
the program goes like this
int option;
cout<<"Enter 1 to encrypt, 2 to decrypt, 3 to quit"< cin>>option;
while (option!=3) {
if (option==1) {
cout<<"Enter a message to encrypt (! to quit)"< char letter;
cin>>letter;
while (letter!='!'){
if (letter=='k') cout<<"1 ";
26 more if stats
cin>>letter;
}
}
else if (option==2) {
cout<<"Enter a message to decrypt (0 to quit)"< int code;
cin>>code;
while (code!=0){
if (code==1) cout<<"k";
26 more if stats
cin>>code;
}
}
}
return 0;
}
ok the not so minor problem is that i need this program to "reset" (start with the first phrase) every time after a message is decrypted or encrypted, but it will keep repeating the end/dec based on what you did
what do i need to change
and also where do i need to put the endl; to not have the press. any key.. right after the decryption is shown

2007-02-13 07:15:04 · 1 answers · asked by Alex P 2 in Computers & Internet Programming & Design

1 answers

put a do...while loop around the whole thing.

If you're running this within the VC++ environment, it's the environment that's producing the "press any key" button - you can't get away from that unless you run the executable outside of VC++.

2007-02-13 13:00:51 · answer #1 · answered by BigRez 6 · 0 0

fedest.com, questions and answers