ok I wrote something not sure how right it is but i do need some help on it
here is what i have:
int menu(int x){
cout<<"Press 1 to encrypt, 2 to decrypt, 3 to quit)"<
cin>>x;
return x;
}
void encrypt(char letter){
cout<<"Enter a message to encrypt"<
cin>>letter;
while (letter!='!'){
if (letter=='k') cout<<"1 ";
then 26 more if statements for letters
cin>>letter;
}
return;
}
void decrypt(int code){
cin>>code;
while (code!=0){
if (code==1) cout<<"k";
26 more if statements
cin>>code;
}
return;
}
int main(){
int choice;
int shift = 7; // default shift
choice = menu();************
while (choice != 3){
if (choice == 1){
cout << "Enter the 'shift' value: ";
cin >> shift;
encrypt(shift); }
else
decrypt();************
cout<
choice = menu(); **********
}
return 0
2007-02-26
16:43:18
·
2 answers
·
asked by
Alex P
2
in
Computers & Internet
➔ Programming & Design
when I try to run this it gives me errors where i put down starts (3 of them)
the error says function does not take 0 arguments
I'm not sure what I'm supposed to put inside the parentheses to make this right
and also, somehow I need to change the function encrypt from encrypt(char) to encrypt(int) I dont know how to do that either
2007-02-26
16:44:43 ·
update #1