diff options
| author | Arthur Spears <[email protected]> | 2024-01-13 13:33:45 -0800 |
|---|---|---|
| committer | Arthur Spears <[email protected]> | 2024-01-13 13:33:45 -0800 |
| commit | 790079a0058668591a9dd1a4354074828915a484 (patch) | |
| tree | a283b06635a4653b883947e3916103068055147e /InClassExercise4 | |
| parent | init (diff) | |
| download | in-class-exercise-4-arthurtspears-develop.tar.xz in-class-exercise-4-arthurtspears-develop.zip | |
exercise completedevelop
Diffstat (limited to 'InClassExercise4')
| -rw-r--r-- | InClassExercise4/InClassExercise4/Source.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/InClassExercise4/InClassExercise4/Source.cpp b/InClassExercise4/InClassExercise4/Source.cpp index e69de29..6a98448 100644 --- a/InClassExercise4/InClassExercise4/Source.cpp +++ b/InClassExercise4/InClassExercise4/Source.cpp @@ -0,0 +1,53 @@ +// Name: Arthur Spears +// Date: 1/13/24 +// Class: CST 116 +// Assignment: InClass Exercise 4 + +#include <iostream> + +using std::cout; +using std::cin; +using std::endl; + +int main() +{ + cout << "Please input a number: "; + + int i = 0; + + cin >> i; + + switch(i) + { + case 100: + cout << "You are so amazing" << endl; + break; + case 5: + cout << "You picked " << i << endl; + break; + case 21: + int j; + int k; + cout << "Input first number: "; + cin >> j; + cout << "Input second number: "; + cin >> k; + if(k==0) + { + cout << "Cannot divide by zero" << endl; + break; + } + int g; + g = j % k; + cout << "The remainder of " << j << " divided by " << k << " is " << g << endl; + break; + + default: + cout << "Bad input, no switches to switch"; + break; + } + + + + return 0; +}
\ No newline at end of file |