The character set is as much a property of the target platform |
I'm not really understanding this. C++ mandates the use of ASCII, how can character sets be a property of the platform?
Because the problem statement explicitly allows making that assumption. |
Yes, but that's dodging the point which is that C++ is running on the ASCII system. If character sets suddenly became dependent on the machine, or "implementation" which I'm not sure what you mean by, then most code depending on it would break and wouldn't even resemble portability.
This character set is sufficient to implement OP's problem |
Well, yes, but who exactly is going to implement this? Would that be a hard-coded character set? Is there another way to make C++ just recognize this new character set without hard coding it?
The assumptions you're making are too strong. |
Are they though? The problem says "Assuming the ASCII value for ‘a’ is greater than ‘A’", which clearly states using the ASCII system. If you have different values or "character set", it's no longer ASCII but something made up or a new system.
Learning how to read a requirements spec is a basic engineering skill that you better acquire. |
I wouldn't consider this relatable. Professor assignments are
always vaguely worded because they fear they'll give away how to code certain things otherwise. When programming my assignments, most of the time spent on it isn't even coding, but trying to decode broken vague English.
If a requirement spec sheet like this showed up in my email, I'd probably ask for more information about it, since it seems like it's trying to allude to something but not actually saying what - very similar to all coding assignments I've ever gotten.
If a spec says something like "the program may assume that integers are always 32 bits long" |
There's no ambiguity there. It wouldn't make sense for me to screw up programming under this assumption, even if my comprehension skills were questionable - I'd just be highly incompetent.
The difference between this and the assignment details is that this pretend spec sheet gives a clear restriction. If you were to restrict yourself only to the assumptions given in this assignment, assuming there's an actual solution to the problem would also be to "high" an assumption. After all, it doesn't say that the difference between 'a' and 'A' will be the same difference between all character's lower and upper case versions.
I don't see how my very minor assumption that the language standard for character sets is going to be used, especially when referenced in the problem, is going on a limb.