-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSwitchGrade.cpp
More file actions
30 lines (29 loc) · 760 Bytes
/
Copy pathSwitchGrade.cpp
File metadata and controls
30 lines (29 loc) · 760 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
//Lab 2 Grade Translator with Challenge
#include <iostream>
using namespace std;
int main()
{
int testScore;
cout << "Enter your test score: ";
cin >> testScore;
switch (testScore) {
case 90 ... 100:
cout << "Your grade is an A.\n";
break;
case 80 ... 89:
cout << "Your grade is a B.\n";
break;
case 70 ... 79:
cout << "Your grade is a C.\n";
break;
case 60 ... 69:
cout << "Your grade is a D.\n";
break;
case 1 ... 59:
cout << "Your grade is an F.\n";
break;
default:
cout << "That isn't in our grading system. Do you even go here?\n";
break;
}
}