I am working on an encryption code for my homework and I wish to add, subtract, multiply and divide every other letter. For example "This is a message". I would like to add "T" to the key, subtract "h" from the key, multiply "i" by the key and divide "s" by the key.

I am wondering if there is a way to change the operator instead of repeating the same block of code 4 times?

Here is the part of code I wish to repeat:

The + I want to swap for - \* /

```
        newletters[x]=(char) (letters[x]+key[x]);

```

And this is the rest of the method: 

```
public static void LetterChange(){
    int x=0;
    int tocarry;
    int newkey;
    newletters=new char[size];
    for (int count=0; (sizeofstring/4)>count; count++){
//ADDITION
        newletters[x]=(char) (letters[x]+key[x]);        
//If character too big
        if (newletters[x]>126){
            tocarry=(int)newletters[x]-127;
            newletters[x]=(char) (33+tocarry);
        }
//If character too small
        if (newletters[x]<33){
            tocarry=(int)33-newletters[x];
            newletters[x]=(char) (127-tocarry);
        }
        x=x+1;
    }
}  

```