blob: c6f3c636dce0676accd9e083d74d4b8562aeab58 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
// 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;
int x = 0;
int y = 0;
int z = 0;
int B = 1;
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:
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 << "are you ready?" << endl;
for (auto i = 0u; i <= 1; i++)
{
cout << "This is your last chance to avoid my strongest move!" << endl;
cout << "INFINITY LOOP" << endl;
cout << "Are you sure you want to continue down this path?" << endl;
cout << "If you want to return to safety, enter any number but 1" << endl;
cin >> B;
while (B == 1)
{
cout << "GET STUCK" << endl;
}
break;
}
break;
case 5:
O = 1;
break;
default:
cout << "Invalid choice. Please enter a number from 1 to 5." << endl;
}
}
return 0;
}
|