-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (38 loc) · 837 Bytes
/
Copy pathProgram.cs
File metadata and controls
44 lines (38 loc) · 837 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
int score = 99;
char grade;
grade = score >= 90 ? 'A' : score >= 80 ? 'B' : score >= 70 ? 'C' : score >= 60 ? 'D' : 'F';
Console.WriteLine("Your grade is: " + grade);
// switch (score)
// {
// case >= 90:
// grade = 'A';
// break;
// case >= 80:
// grade = 'B';
// break;
// case >= 70:
// grade = 'C';
// break;
// case >= 60:
// grade = 'D';
// break;
// default:
// grade = 'F';
// break;
// }
// Console.WriteLine("Your grade is: " + grade);
// if (score >= 90) {
// grade = 'A';
// }
// else if (score >= 80) {
// grade = 'B';
// }
// else if (score >= 70) {
// grade = 'C';
// }
// else if (score >= 60) {
// grade = 'D';
// }
// else {
// grade = 'F';
// }