Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Grade { //makes the enum for grading
- 9 = A+, //grade level 9 = A+
- 8 = A, //and so on...
- 7 = B+,
- 6 = B,
- 5 = C+,
- 4 = C,
- 3 = D,
- 2 = E,
- 1 = F,
- 0 = U
- }
- static void Main(string[] args)
- {
- Grade myGrade = 5; //standard grade is a 5/C+
- switch(myGrade) //changes the grade
- {
- case Grade.9: //if you get a 9...
- Console.WriteLine("You got an A+") //you get an a+
- break; //and that's it
- case Grade.8: //and so on...
- Console.WriteLine("You got an A")
- break;
- case Grade.7:
- Console.WriteLine("You got a B+")
- break;
- case Grade.6:
- Console.WriteLine("You got a B")
- break;
- case Grade.5:
- Console.WriteLine("You got a C+")
- break;
- case Grade.4:
- Console.WriteLine("You got a C")
- break;
- case Grade.3:
- Console.WriteLine("You got a D")
- break;
- case Grade.2:
- Console.WriteLine("You got an E")
- break;
- case Grade.1:
- Console.WriteLine("You got an F")
- break;
- case Grade.0:
- Console.WriteLine("You got an U")
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement