diff options
| author | natabrown <[email protected]> | 2024-01-16 23:54:24 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-16 23:54:24 -0800 |
| commit | 3c348c617803ffdb3fbf2cb077cd6628f9e281f1 (patch) | |
| tree | 156d4eef92f47116084431759eba5f339a90402f /In Class Ex 4/Project1/EX4.cpp | |
| parent | add deadline (diff) | |
| parent | Final commit (diff) | |
| download | in-class-exercise-4-natabrown-main.tar.xz in-class-exercise-4-natabrown-main.zip | |
Develop
Diffstat (limited to 'In Class Ex 4/Project1/EX4.cpp')
| -rw-r--r-- | In Class Ex 4/Project1/EX4.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/In Class Ex 4/Project1/EX4.cpp b/In Class Ex 4/Project1/EX4.cpp new file mode 100644 index 0000000..7ab574a --- /dev/null +++ b/In Class Ex 4/Project1/EX4.cpp @@ -0,0 +1,54 @@ + +// Name: Nataliia Brown +// Date: 1/13/24 +// Class: CST 116 +// Assignment: InClass Exercise 4 + +#include <iostream> + + +using std::cout; +using std::cin; +using std::endl; + +int main() +{ + + int i; + cout << "please input a number: " << endl; + + cin >> i; + + switch (i) + { + case 100: + cout << "You are a great person" << endl; + break; + case 5: + cout << "You picked option : " << i << endl; + break; + case 21: + int j; + int k; + cout << "please input number 1: "; + cin >> j; + cout << "please input number 2: "; + cin >> k; + if (k == 0) + { + cout << "cannot divide by zero" << endl; + break; + } + int g; + g = j % k; + cout << "the remainder of " << j << "devided by " << k << " is " << g << endl; + break; + + default: + cout << "Bad input, no switches to switch"; + break; + } + + + return 0; +}
\ No newline at end of file |