Friday, 1 December 2017

C# Program to Read a Grade & Display the Equivalent Description


Code:

using System;
using System.IO;
class program
{
    public static void Main()
    {
        char grade;
        Console.WriteLine("Enter the Grade in UpperCase \n");
        grade = Convert.ToChar(Console.ReadLine());
        switch (grade)
        {
        case 'S':
            Console.WriteLine(" SUPER");
            break;
        case 'A':
            Console.WriteLine(" VERY GOOD");
            break;
        case 'B':
            Console.WriteLine(" FAIR");
            break;
        case 'Y':
            Console.WriteLine(" ABSENT");
            break;
        case 'F':
            Console.WriteLine(" FAIL");
            break;
        default:
            Console.WriteLine("ERROR IN GRADE \n");
            break;
            Console.ReadLine();
        }
    }
}


Output:

Enter the Grade in UpperCase
A
 VERY GOOD



More C# Programs:

















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...