From 488736a92a600eb6a95ca14f20932e68d475f250 Mon Sep 17 00:00:00 2001 From: Miles-Cell <156042454+Miles-Cell@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:27:03 -0800 Subject: Re-committing completed exercise. Corrected file location. --- InClassExercise4/InClassExercise4/Source.cpp | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'InClassExercise4') 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 + +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 -- cgit v1.2.3