From ecfcfc0562e74a8ea099a6979bba694655b13a85 Mon Sep 17 00:00:00 2001 From: Nataliia Brown Date: Tue, 16 Jan 2024 23:48:54 -0800 Subject: Final commit --- In Class Ex 4/Project1/EX4.cpp | 54 +++++++++++++++++++++++++ In Class Ex 4/Project1/Project1.vcxproj | 37 ++++++++--------- In Class Ex 4/Project1/Project1.vcxproj.filters | 5 +++ 3 files changed, 76 insertions(+), 20 deletions(-) diff --git a/In Class Ex 4/Project1/EX4.cpp b/In Class Ex 4/Project1/EX4.cpp index e69de29..7ab574a 100644 --- a/In Class Ex 4/Project1/EX4.cpp +++ 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 + + +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 diff --git a/In Class Ex 4/Project1/Project1.vcxproj b/In Class Ex 4/Project1/Project1.vcxproj index 9f08087..3871ffd 100644 --- a/In Class Ex 4/Project1/Project1.vcxproj +++ b/In Class Ex 4/Project1/Project1.vcxproj @@ -17,7 +17,6 @@ Release x64 - 17.0 @@ -53,27 +52,24 @@ true Unicode - - + + + + + + + + + + + + + - - - - - - - - - - - - - - Level3 @@ -130,9 +126,10 @@ true - - + + + - + \ No newline at end of file diff --git a/In Class Ex 4/Project1/Project1.vcxproj.filters b/In Class Ex 4/Project1/Project1.vcxproj.filters index a8a6563..d3ae225 100644 --- a/In Class Ex 4/Project1/Project1.vcxproj.filters +++ b/In Class Ex 4/Project1/Project1.vcxproj.filters @@ -14,4 +14,9 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + Source Files + + \ No newline at end of file -- cgit v1.2.3