A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a program in C# Sharp to accept a grade and declare the equivalent description
Q:

Write a program in C# Sharp to accept a grade and declare the equivalent description

0

Write a program in C# Sharp to accept a grade and declare the equivalent description :

Sample Output:

Accept a grade and display equivalent description:                                                            
---------------------------------------------------                                                           
Input the grade :V                                                                                            
You have chosen  :  Very Good

Grade Description
E Excellent
V Very Good
G Good
A Average
F Fail

 

 

 

 

 

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
public   class exercise19
   {
       static void Main(string[] args)
    {
    string notes;
    char grd;
          Console.Write("\n\n");
           Console.Write("Accept a grade and display equivalent description:\n");
           Console.Write("---------------------------------------------------");
           Console.Write("\n\n");

 
    Console.Write("Input the grade :");
    grd = Convert.ToChar(Console.ReadLine().ToUpper());

    switch(grd)
    {
    case 'E':
        notes= " Excellent";
        break;
    case 'V':
       notes= " Very Good";
        break;
    case 'G':
        notes= " Good ";
        break;
    case 'A':
        notes= " Average";
        break;
    case 'F':
        notes= " Fails";
        break;
    default :
        notes= "Invalid Grade Found.";
        break;
    }
    Console.Write("You have chosen  : {0}\n", notes);
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now