Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* William Chen, Evan Graham, Brian Te
Period 4
October 5, 2017

Assignment Name : Three Digit Ascending Descending Selection

Let a user enter a three-digit number and the output will either read ascending or descending depending on the order of the characters in value.
/* William Chen, Evan Graham, Brian Te
Period 4
October 5, 2017

Assignment Name : Three Digit Ascending Descending Selection
Let a user enter a three-digit number and the output will either read ascending or descending depending on the order of the characters in value.
*/

// Libraries
Expand Down Expand Up @@ -35,6 +33,7 @@ void pause() {

void main() {
int number;
for (int i = 1; i <= 30; i++) { // 30x loop
cout << "…………………▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄" << endl;
cout << "……………▄▄█▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓▓█▄▄" << endl;
cout << "…………▄▀▀▓▒░░░░░░░░░░░░░░░░▒▓▓▀▄" << endl;
Expand Down Expand Up @@ -74,27 +73,28 @@ void main() {
cout << "………………………..▀▀██▓▓▓▓██▀" << endl;
cout << endl;
cout << endl;
cout << "You've been spooked by the spookedly skeletor! Please input a three digit number in order to save your pathetic life!" << endl;
cout << "You've been spooked by the spookedly skeletor! Please input a three digit number in order to save your pathetic life!" << endl; // Message displayed to spook the user
cout << endl;
cin >> number;
cout << endl;
int A = number / 100;
int B = (number % 100) / 10;
int C = (number % 100) % 10;


if ((A > B) && (B > C)) {
cout << "Descending to Hell!" << endl;
cout << endl;
}

else if ((A < B) && (B < C)) {
cout << "Ascending to Heaven!" << endl;
cout << endl;
int A = number / 100; // Shows the number in the hundreds place
int B = (number % 100) / 10; // Shows the number in the tens place
int C = (number % 100) % 10; //Shows the number in the ones place


if ((A > B) && (B > C)) {
cout << number << " is descending" << endl; // Message displayed if the numbers are descending
cout << endl;
}

else if ((A < B) && (B < C)) {
cout << number << " is ascending" << endl; // Message displayed if the numbers are ascending
cout << endl;
}
else {
cout << number << " is neither" << endl; //Message displayed if neither ascending or descending
cout << endl;
}
}
else {
cout << "No judgement" << endl;
cout << endl;
}
pause(); // pauses to see the displayed text
}
pause(); // Pause to see the displayed text
}