aboutsummaryrefslogtreecommitdiff
path: root/Project1/project.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/project.cpp')
-rw-r--r--Project1/project.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/Project1/project.cpp b/Project1/project.cpp
new file mode 100644
index 0000000..4cdff64
--- /dev/null
+++ b/Project1/project.cpp
@@ -0,0 +1,62 @@
+// name: Connor McDowell
+// date: 3/9/2024
+// class: CST 116
+// reason: in class exercise 4
+
+#include <iostream>
+
+using std::cin;
+using std::cout;
+using std::endl;
+
+int main()
+{
+ int O = 0;
+ int c = 0;
+ while(O == 0)
+ {
+ cout << "Please enter a number from and including 1 through 5!" << endl;
+ cout << "Number 5 will close the program" << endl;
+ cout << "I highly recommend not pressing 4." << endl;
+ cin >> c;
+ switch (c)
+ {
+ case 1:
+ cout << "Programmer? I hardly know 'er!!" << endl;
+ break;
+ case 2:
+ cout << "You've selected option 2!" << endl;
+ break;
+ case 3:
+ int x = 0;
+ int y = 0;
+ int z = 0;
+ cout << "Please enter a number when prompted, this will happen twice." << endl;
+ cout << "Please enter a whole, non-negative and non-zero number: ";
+ cin >> x;
+ cout << "\n";
+ cout << "Enter a second, whole, non-negative, and non-zero number: ";
+ cin >> y;
+ cout << "\n";
+ z = x % y;
+ cout << "The remainder left over after " << x << " is divided by " << y << " is: " << z << endl;
+ break;
+ case 4:
+ cout << "ooooo you found the secret option! Prepare for my ultimate attack!" << endl;
+ cout << "INFINITY LOOP" << endl;
+ cout << "(sorry)" << endl;
+ int B = 1;
+ while(B = 1)
+ {
+ cout << "GET STUCK" << endl;
+ }
+ break;
+ case 5:
+ O = 1;
+ break;
+ default:
+ cout << "Invalid choice. Please enter a number from 1 to 5." << endl;
+ }
+ }
+ return 0;
+} \ No newline at end of file