aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--InClassExercise4/InClassExercise4/Source.cpp36
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