diff options
| author | Miles-Cell <[email protected]> | 2024-01-24 21:27:03 -0800 |
|---|---|---|
| committer | Miles-Cell <[email protected]> | 2024-02-03 11:34:57 -0800 |
| commit | 488736a92a600eb6a95ca14f20932e68d475f250 (patch) | |
| tree | 8deb1a1d124eaa770f6526e07ece6b0fd4e89e72 | |
| parent | Created project, added Source.cpp (diff) | |
| download | in-class-exercise-4-miles-cell-develop.tar.xz in-class-exercise-4-miles-cell-develop.zip | |
Re-committing completed exercise. Corrected file location.develop
| -rw-r--r-- | InClassExercise4/InClassExercise4/Source.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/InClassExercise4/InClassExercise4/Source.cpp b/InClassExercise4/InClassExercise4/Source.cpp index e69de29..2dc4d53 100644 --- a/InClassExercise4/InClassExercise4/Source.cpp +++ b/InClassExercise4/InClassExercise4/Source.cpp @@ -0,0 +1,36 @@ +// Name: Miles Ellsworth +// Date: 1/23/2024 +// Class: CST 116 +// Assignment: InClass Exercise 4 + +#include <iostream> + +int main() +{ + int number; + std::cout << "Enter a number: "; + std::cin >> number; + + std::cout << "You entered: " << number << std::endl; + + switch (number) { + case 1: + std::cout << "You are a great person" << std::endl; + break; + case 2: + std::cout << "You entered 2" << std::endl; + break; + case 3: + int num1, num2; + std::cout << "Enter the first number: "; + std::cin >> num1; + std::cout << "Enter the second number: "; + std::cin >> num2; + std::cout << "The remainder of " << num1 << " divided by " << num2 << " is " << num1 % num2 << std::endl; + break; + default: + std::cout << "Bad input! No switches to switch." << std::endl; + break; + } + return 0; +}
\ No newline at end of file |