Monday, May 24, 2010

Some more help with c++ plz?

i only have one minor and one more than minor problem left


the program goes like this


int option;


cout%26lt;%26lt;"Enter 1 to encrypt, 2 to decrypt, 3 to quit"%26lt;%26lt;endl;


cin%26gt;%26gt;option;


while (option!=3) {


if (option==1) {


cout%26lt;%26lt;"Enter a message to encrypt (! to quit)"%26lt;%26lt;endl;


char letter;


cin%26gt;%26gt;letter;


while (letter!='!'){


if (letter=='k') cout%26lt;%26lt;"1 ";


26 more if stats


cin%26gt;%26gt;letter;


}


}


else if (option==2) {


cout%26lt;%26lt;"Enter a message to decrypt (0 to quit)"%26lt;%26lt;endl;


int code;


cin%26gt;%26gt;code;


while (code!=0){


if (code==1) cout%26lt;%26lt;"k";


26 more if stats


cin%26gt;%26gt;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

Some more help with c++ plz?
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++.


No comments:

Post a Comment