-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathex17.cpp
More file actions
40 lines (33 loc) · 809 Bytes
/
ex17.cpp
File metadata and controls
40 lines (33 loc) · 809 Bytes
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
/*
CPSC 121-0X
Paul De Palma
depalma
Example 17
*/
//switch
#include <iostream>
using namespace std;
int main()
{
char choice;
cout << "Enter E to hear Emily Dickenson" << endl;
cout << "Enter S to hear Shakespeare" << endl;
cout << "Enter T to hear T.S. Eliot" << endl;
cout << "Enter M to hear Andrew Marvell" << endl;
cin >> choice;
switch(choice)
{
case 'E': cout << "I'm nobody, who are you?\n";
break;
case 'S': cout << "Full fadom five, thy father lies\n";
break;
case 'T': cout << "Let us go, then, you and I\n";
break;
case 'M': cout << "Andrew Marvell\n";
break;
default: cout << "You didn't enter E,S,T, or M\n";
cout << "Don't you like English poetry?\n";
}
cout << endl;
return 0;
}