C# program to read the grade of students and print the appropriate description of grade
All Answers
total answers (1)
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
total answers (1)
Program:
The source code to print the description of the specified grade in C# is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a GradeDemo class that contains the Main() method. Here we created the variable student_grade of character type.
In the above statements we took grade as input using ReadLine() method and then convert it into single character using ToChar() method, because ReadLine() method takes string as a input.
After that, we matched input grade using switch-case and print the appropriate description on the console screen.