int main()
{
Encoding encode, decode, cipher_shift ;
string keycode, entered_words, again;
do
{
cout <<"Welcome to the Caesar Encoder/Decoder!" << endl;
cout <<"Would you like to Encode or Decode or Quit? ";
getline(cin, keycode);
cout <<"Please enter a string that you would like to "<<keycode <<" :\n";
cout <<"(Please end your string with a ~ symbol and then press Enter key)\n";
getline(cin, entered_words);
cipher_shift.getshift();
if (keycode=="Encode")
{
encode.get_encoding(entered_words);
encode.print_result(keycode);
}
else if (keycode =="Decode")
{
decode.get_decoding(entered_words);
decode.print_result(keycode);
}
else if (keycode=="Quit")
exit;
cout <<"Would you like to encode/decode another string? (Yes/No): ";
getline(cin, again);
system("cls");
}
while ( again == "Yes");
system ("pause");
return 0;
}
please help!
this is an encoding game
i don't know how to convert string to integer before i do the operation:
for (int i=0; i < wlen; i++)
coding_words.at(i) = coding_words.at(i) -shift;