diff options
| author | JacobAKnox <[email protected]> | 2021-11-10 10:07:59 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-10 10:07:59 -0800 |
| commit | e5b7e635713fe869d8500fb6375c17c62086654f (patch) | |
| tree | 0434ca5ec15d8dcabf67b3ad0ed414cf7e76014e | |
| parent | Merge pull request #6 from austinsworld15/patch-6 (diff) | |
| parent | Update KnoxFunctions.cpp (diff) | |
| download | cst116proj2-1-jacob-k-and-austin-g-e5b7e635713fe869d8500fb6375c17c62086654f.tar.xz cst116proj2-1-jacob-k-and-austin-g-e5b7e635713fe869d8500fb6375c17c62086654f.zip | |
Merge pull request #5 from austinsworld15/patch-5
Update KnoxFunctions.cpp
| -rw-r--r-- | KnoxFunctions.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/KnoxFunctions.cpp b/KnoxFunctions.cpp index 07e9d1c..c5ee708 100644 --- a/KnoxFunctions.cpp +++ b/KnoxFunctions.cpp @@ -102,3 +102,33 @@ void DisplayAdditonTable() cout << "\n"; } } + +void GetData(int& Number) +{ + cout << "\n-----Input a number between negative one million and one million to be tested-----\n"; + cin >> Number; + while (Number > 1000000 || Number < -1000000) + { + cout << "\nYou did not enter a number in between the designated values, try again: \n\n" << endl; + cin >> Number; + } + cout << "\nYou entered the value: " << Number << endl; +} + +void IsOddEven(int& Number) +{ + cout << "\n\nCalculating if the number entered is even, odd, or 0\n\n"; + + if (Number % 2 == 0 && Number != 0) + cout << Number << " is even.\n\n"; + else if (Number % 2 == 1 && Number != 0) + cout << Number << " is odd.\n\n"; + else if (Number == 0) + cout << "This number is a 0.\n\n"; +} + +void FindDigitAtPosition(int Digit, int Position, int& Number) +{ + cout << "\nThe number you have chosen from before is " << Number << ", what position of that number do you want to see where that digit is outputted?\n"; + cin >> Position; +} |