aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-02-26 14:37:52 -0600
committerRossTheRoss <msattr@gmail.com>2019-02-26 14:37:52 -0600
commit521b91de8aca21efb1f72926c6bcc4e579ad8e1b (patch)
tree3344d7b671a6cea12b7eb4da4c0ce417ab41c9f8
parentUpdate README.md (diff)
downloadhomework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar.gz
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar.bz2
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar.lz
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar.xz
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.tar.zst
homework-521b91de8aca21efb1f72926c6bcc4e579ad8e1b.zip
Get rid of double negative
Diffstat (limited to '')
-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) {