diff options
Diffstat (limited to 'ee1301/wk3/hw3_directory/strap012_HW3B.cpp')
-rw-r--r-- | ee1301/wk3/hw3_directory/strap012_HW3B.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp index 128f5fa..1b3faed 100644 --- a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp +++ b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp @@ -14,29 +14,6 @@ Character Detection #include <iomanip> using namespace std; -// Function: charTest -// --------------------------- -// Tests to see what kind of character was inputted -// character: Self-explanatory -// returns: 1 if number, 2 if lower case, 3 if upper case, 0 if not any of the previous - -int charTest (char character) { - if (character >= '0' && character <= '9') - { - return 1; - } else { - if (character>='a' && character<='z') { - return 2; - } else { - if (character>= 'A' && character<='Z') { - return 3; - } else { - return 0; - } - } - } -} - int main () { int test; char character; @@ -62,3 +39,27 @@ int main () { cout << endl; } } + + +// Function: charTest +// --------------------------- +// Tests to see what kind of character was inputted +// character: Self-explanatory +// returns: 1 if number, 2 if lower case, 3 if upper case, 0 if not any of the previous + +int charTest (char character) { + if (character >= '0' && character <= '9') + { + return 1; + } else { + if (character>='a' && character<='z') { + return 2; + } else { + if (character>= 'A' && character<='Z') { + return 3; + } else { + return 0; + } + } + } +}
\ No newline at end of file |