-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest4c.cpp
56 lines (47 loc) · 1.05 KB
/
test4c.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
55
56
//Program:3-9
//Author:James
//Date: 19/7/2019
//Description: THis program deministrate the use of a switch stament
//THe program simply tells the user what character they entered
#include<iostream>
using namespace std;
int main()
{
char choice;
cout<<"Enter A,B,or C: ";
cin>> choice;
switch(choice)
{
case 'A':cout<<"You entered A.\n";
break;
case'B': cout<<"You entered B.\n";
break;
case 'C':cout<<"You entered C.\n";
break;
default: cout<<"You did not enter A,B,orC!\n";
}
return 0;
}
//Program: 3-9
//Author : James
//Date:
//Descriprtion: This program deministrate the use of the switch stament.
// The program simply tell the user what character they entered.
#include<iostream>
using namespace std;
int main()
{
char choice ;
cout<< "Enter you A, B, or c; ";
cin>> choice;
switch (choice)
{case 'A': cout<< " You entered A:\n";
break ;
case 'B': cout<< " You entered B: \n";
break;
case 'C': cout << " You enter C:\n";
break;
default: cout << " You did not enter A, B, or C!\n";
}
return 0;
}