-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDSA Week Two Labs
More file actions
54 lines (39 loc) · 920 Bytes
/
DSA Week Two Labs
File metadata and controls
54 lines (39 loc) · 920 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int grade,
aCount = 0,
bCount = 0,
cCount = 0,
dCount = 0,
eCount = 0,
fCount = 0;
cout << "Enter the letter grades" << endl
<< "Enter the EOF character to end input." << endl;
while ( ( grade = cin.get() ) !=EOF ){
if (grade = "A" || "a")
cout << ++aCount;
else if (grade = "B" || "b")
cout << ++bCount;
else if (grade = "C" || "c")
cout << ++cCount;
else if (grade = "D" || "d")
cout << ++dCount;
else if (grade = "E" || "e")
cout << +eCount;
else if (grade = "F" || "f")
cout << ++fCount;
else
cout <<"Incorrect letter grade entered." << "Enter a new grade." << endl;
}
cout << " \n\nTotal foe each letter grade are: "
<< " \nA: " << aCount
<< " \nB: " << bCount
<< " \nC: " << cCount
<< " \nD: " << dCount
<< " \nF: " << fCount << endl;
return 0;
}