From 03d58102306d50fb901c4dd4f7d69f9d50122619 Mon Sep 17 00:00:00 2001 From: marcusman007 <31863992+marcusman007@users.noreply.github.com> Date: Mon, 16 Oct 2017 13:59:28 -0500 Subject: [PATCH] Asignment 4 I created a loop for it to run 30 times --- ...KyleAustin_MaazKamal_JustinVanNimwegen.cpp | 73 +++++++++---------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/Three_Digit_Ascend_Descend_Selection/KyleAustin_MaazKamal_JustinVanNimwegen.cpp b/Three_Digit_Ascend_Descend_Selection/KyleAustin_MaazKamal_JustinVanNimwegen.cpp index eaf3212..40c2498 100644 --- a/Three_Digit_Ascend_Descend_Selection/KyleAustin_MaazKamal_JustinVanNimwegen.cpp +++ b/Three_Digit_Ascend_Descend_Selection/KyleAustin_MaazKamal_JustinVanNimwegen.cpp @@ -1,47 +1,40 @@ -/* -Maaz Kamal, Kyle Austin, Justin Van Nimwegen, Yezen Higazin - 4 - -Assignment Name : Three_Digit_Ascend_Descend_Selection - -Taking in data and tranfering into 'if' statements - +/* +-Maaz Kamal, Kyle Austin, Justin Van Nimwegen, Yezen Higazin - 4 + Edited By: Marcus Basta +Assignment: Three Digit Ascend Decend Selection */ - -//Libraries -#include +#include #include -//namespaces using namespace std; -//functions -void pause() { - cout << "Press any key to continue . . ."; - while (!_kbhit()); - _getch(); - cout << '/n'; -} -void main() { - int x; - cout << "Choose a 3 Digit #" << endl; - cin >> x; - cout << "You Chose " << x << endl; - - int A = x / 100; - int B = x % 100 / 10; - int C = x % 10; - - if ((A > B) && (B > C)) { - cout << "Decending" << endl; - - } - else if ((A < B) && (B < C)) { - cout << "Acending" << endl; - } - else { - cout << "Neither" << endl; - } + void pause() { + cout << "press any key to continue. . . "; + while (!_kbhit()); + _getch(); + cout << '/n'; +} - pause(); -} \ No newline at end of file + void main() { + int x; + + for (int i = 1; i <= 30; i++) { + cout << i << endl; + cout << "Choose a 3 Digit #" << endl; + cin >> x; + int A = x / 100; + int B = x % 100 / 10; + int C = x % 10; + cout << "Choose wiseley " << x << endl; + if ((A > B) && (B > C)) { + cout << "decending" << endl; + } + else if ((A < B) && (B < C)) { + cout << "acending" << endl; + } + else { + cout << "neither" << endl; + } + } + }