aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301
diff options
context:
space:
mode:
Diffstat (limited to 'ee1301')
-rw-r--r--ee1301/wk3/hw3_directory/strap012_HW3B.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp
index ffb669e..128f5fa 100644
--- a/ee1301/wk3/hw3_directory/strap012_HW3B.cpp
+++ b/ee1301/wk3/hw3_directory/strap012_HW3B.cpp
@@ -40,14 +40,14 @@ int charTest (char character) {
int main () {
int test;
char character;
- bool isNotAlphaNumeric=false;
- while (!isNotAlphaNumeric) {
+ bool isAlphaNumeric=true;
+ while (isAlphaNumeric) {
cout << "Enter a single digit or an alphabetic character: ";
cin >> character;
cout << "You entered " << character << ", ";
test = charTest(character);
if (test==0) {
- isNotAlphaNumeric=true;
+ isAlphaNumeric=false;
cout << "which is not a letter or a number.";
}
if (test==1) {