You are correct - that's an error in the specification, since it fails to state what you should do in such a case and is therefore incomplete. Well spotted :) You should indeed check that the Vigenère key meets the criteria for validity, and should print an error message and return 1 if it does not.
(Although there's only a very limited range of things you could do, without breaching some other portion of the specification. It would be incorrect for your cli
function to ever call the Vigenère functions with arguments that breached the preconditions, so you mustn't do that. And the only way to avoid doing so is by validating the argument passed in cli
.)
Cheers
Arran
Hi,
When we are validating the key input for the cli function, the spec only mentions that we must check if it is an appropriate int for Caesar encryption and decryption.
It does not state about checking if Vigenere is given an appropriate string where each of its characters are in the acceptable range, and is non-empty.
Is this implied or does cli not have to worry about this?
Thanks