diff options
| author | austinsworld15 <[email protected]> | 2021-11-09 18:37:04 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-09 18:37:04 -0800 |
| commit | c4b60498b2174e679545d144724adc2988bad25f (patch) | |
| tree | 86adf848611870f2085659dbf182ae478f4fd4ce | |
| parent | Merge pull request #1 from austinsworld15/patch-1 (diff) | |
| download | cst116proj2-1-jacob-k-and-austin-g-c4b60498b2174e679545d144724adc2988bad25f.tar.xz cst116proj2-1-jacob-k-and-austin-g-c4b60498b2174e679545d144724adc2988bad25f.zip | |
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 c006e32..0c22a9e 100644 --- a/KnoxFunctions.cpp +++ b/KnoxFunctions.cpp @@ -96,3 +96,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; +} |