Exercise 3: Adding Uppercase Support Without Ten Comparisons — Possible Solution ==================================================================== THE MINIMUM CHANGE ------------------------------ Rather than duplicating all five vowel comparisons for uppercase versions (A/E/I/O/U) as five MORE comparisons, add a single normalization step at the very TOP of ISVOWEL, before any of the existing five comparisons run: check whether the input character falls in the uppercase range ('A' through 'Z'), and if it does, convert it to its lowercase equivalent before falling through into the existing, unchanged lowercase-only comparison chain. WHY THIS WORKS: THE ASCII RELATIONSHIP ------------------------------ In ASCII, every uppercase letter's code is exactly 32 less than its lowercase equivalent ('A' = 65, 'a' = 97; 'E' = 69, 'e' = 101; and so on, consistently for the whole alphabet). So converting any uppercase letter to lowercase is always the same operation: add 32 to its ASCII value. This is the same idea this chapter's own ISVOWEL already uses (comparing ASCII values via subtraction) applied to CONVERSION instead of comparison. PSEUDOCODE ------------------------------ ISVOWEL(R0 = character): if R0 is between 'A' (65) and 'Z' (90) inclusive: R0 = R0 + 32 ; normalize uppercase down to lowercase ; fall through into the existing five lowercase-only comparisons, ; completely unchanged from this chapter's own version Testing "is R0 between 'A' and 'Z'" can itself reuse the same negate-and-add technique this chapter's ISVOWEL already uses for equality checks -- one subtraction to confirm R0 - 'A' is not negative (R0 >= 'A'), and one more to confirm R0 - 'Z' is not positive (R0 <= 'Z'). Only if both hold does the +32 normalization run. WHY THIS IS THE "MINIMUM" CHANGE ------------------------------ The existing five comparisons (against VOWEL_A, VOWEL_E, VOWEL_I, VOWEL_O, VOWEL_U) don't need to change at all -- they still only ever need to handle lowercase input, because the new normalization step guarantees that by the time execution reaches them, ANY vowel letter (uppercase or lowercase) has already been converted to its lowercase form. This adds one small block of new logic instead of duplicating the entire five-comparison chain a second time for uppercase. WHY THIS WORKS AS AN ANSWER ------------------------------ It identifies the actual minimal-change technique (normalize case once, up front, rather than doubling every comparison), grounds it in the real ASCII relationship between uppercase and lowercase letters (a fixed +32 offset), and explains specifically why the existing five comparisons can stay completely unmodified as a result.