-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch.cpp
54 lines (51 loc) · 920 Bytes
/
switch.cpp
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
#include <iostream>
using namespace std;
void showmenu();
void report();
void comfort();
int main()
{
showmenu();
int choice;
cin >> choice;
while (choice != 5) {
switch (choice) {
case 1:
cout << "\a\n";
break;
case 2:
report();
break;
case 3:
cout << "The boss was in all day.\n";
break;
case 4:
comfort();
break;
default:
cout << "That's not a choice.\n";
}
showmenu();
cin >> choice;
}
cout << "Bye!\n";
return 0;
}
void showmenu()
{
cout << "Please enter 1, 2, 3, 4, or 5: \n"
"1) alarm 2) report\n"
"3) alibi 4) comfort\n"
"5) quit\n";
}
void report()
{
cout << "It's been an excellent week for business.\n"
"Sales are up 120%. Expenses are down 35%.\n";
}
void comfort()
{
cout << "Your employees think you are the finest CES\n"
"in the industry. The board of directors think\n"
"you are the finest CEO in the industry\n";
}