Rather than identifying two similar formulas to represent the shift (one for uppercase keyword characters and one for lowercase characters), would it make sense to convert the keyword entered by the user to an all-lowercase-keyword before starting to encipher?
update: thank you for your answer! What do you mean by "ternary operator"?
I wondered whether it'd be "cleaner" to initially check whether the keyword entered was all-lowercase before encryption. If the keyword is not all-lowercase, the keyword could be converted to a 'all-lowercase-keyword' with the code below:
string key = argv[1];
string keyLower = key;
for (int j = 0; j < strlen(key); j++){
keyLower[j] = tolower(key[j]);
}
The encryption would not need to have loops checking whether the jth character of the keyword is upper or lower-case.
Would it make the program more efficient and/or cleaner?