From d9403864aaf2c6e007d52ca925431b347c46a7e8 Mon Sep 17 00:00:00 2001 From: ZB1228 <31863896+ZB1228@users.noreply.github.com> Date: Thu, 12 Oct 2017 13:43:07 -0500 Subject: [PATCH 1/3] Assignment 4 - Zachary Bates Changes for Assignment 4 --- ThreeDigit.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ThreeDigit.cpp b/ThreeDigit.cpp index 9caf505..806acbf 100644 --- a/ThreeDigit.cpp +++ b/ThreeDigit.cpp @@ -34,6 +34,7 @@ void pause() { // MAIN void main() { +for (int i = 0; i < 30; ++i) { int number; // X is a three digit number int digit_a; // hundreds place int digit_b; // tens place @@ -45,26 +46,23 @@ void main() { digit_b = (number % 100) / 10; digit_c = number % 10; - if (digit_a > digit_b && digit_b > digit_c) { - cout << "descending"; + if (digit_a > digit_b && digit_b > digit_c) { + cout << number << " is descending";//prints out descending } else if (digit_a < digit_b && digit_b < digit_c) { - cout << "ascending"; + cout << number << " is ascending"; //prints out ascending } else { - cout << "neither"; + cout << number << " is neither"; //prints out neither } - -pause(); - - +} pause(); // pauses to see the displayed text -} \ No newline at end of file +} From 5d078d71f8ce53f1b324dd3aaa80cc92d6163100 Mon Sep 17 00:00:00 2001 From: ZB1228 <31863896+ZB1228@users.noreply.github.com> Date: Thu, 12 Oct 2017 13:49:48 -0500 Subject: [PATCH 2/3] Assignment 4 - Zachary Bates Assignment 4 changes, revised because I messed up the first time sorry. --- ThreeDigit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ThreeDigit.cpp b/ThreeDigit.cpp index 806acbf..7d6d269 100644 --- a/ThreeDigit.cpp +++ b/ThreeDigit.cpp @@ -40,23 +40,23 @@ for (int i = 0; i < 30; ++i) { int digit_b; // tens place int digit_c; // ones place - cout << "Choose a 3 Digit number:" << endl; + cout << "Choose a 3 Digit number: "; cin >> number; digit_a = number / 100; digit_b = (number % 100) / 10; digit_c = number % 10; if (digit_a > digit_b && digit_b > digit_c) { - cout << number << " is descending";//prints out descending + cout << number << " is descending \n";//prints out descending } else if (digit_a < digit_b && digit_b < digit_c) { - cout << number << " is ascending"; //prints out ascending + cout << number << " is ascending \n"; //prints out ascending } else { - cout << number << " is neither"; //prints out neither + cout << number << " is neither \n"; //prints out neither } From e49df45b30ce02920b40c4dd613c7905658ec7bf Mon Sep 17 00:00:00 2001 From: ZB1228 <31863896+ZB1228@users.noreply.github.com> Date: Thu, 12 Oct 2017 13:56:47 -0500 Subject: [PATCH 3/3] Update ThreeDigit.cpp --- ThreeDigit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ThreeDigit.cpp b/ThreeDigit.cpp index 7d6d269..ad18643 100644 --- a/ThreeDigit.cpp +++ b/ThreeDigit.cpp @@ -34,7 +34,8 @@ void pause() { // MAIN void main() { -for (int i = 0; i < 30; ++i) { +for (int i = 0; i < 30; ++i) { //makes loop for 30 times + int number; // X is a three digit number int digit_a; // hundreds place int digit_b; // tens place