I'm having issues on how to start the shift value part of this assignment. I've gotten the first part of the assignment and making sure the argc is indeed a word or letter and not an integer. Could anyone help me work it out, so I can learn how to approach this in the future and this assignment? My first step would be to break the shift value down in two steps by 1 single letter and a phrase. But would it be beneficial to try and combine both single letter and phrases with an equation or better to try and break it down the problem?
// takes single character as an input
int shift(char c);
int main(int argc, string argv[])
{
// checking the argument if the statement has 2 arguments
if (argc != 2)
{
printf("Usage: ./vigenere keyword ");
return 1;
}
else
{
// making sure the keyword is A-Z
for (int i = 0, n = strlen(argv[1]); i < n; i++)
{
// if it is not alphabetical
if (!isalpha(argv[1][i]))
{
printf("Usage: ./vigenere keyword ");
return 1;
}
}
}
// asking for the plaintext to be encoded by the key
string p = get_string("plaintext: ");
printf("ciphertext: ");
// storing the key
}