Q:

using method, read c# program asks student to enter his mark out of 10 , then prints the resulting grade

0

using method, read c# program asks student to enter his mark out of 10 , then prints the resulting grade

All Answers

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

internal class Program
{
    public static char getGrade(int mark)
    { 
        if(mark>=90 && mark<=100)
            return 'A';
        else if (mark >= 80 && mark <= 89)
            return 'B';
        else if (mark >= 70 && mark <= 79)
            return 'C';
        else if (mark >= 60 && mark <= 69)
            return 'D';
        else return 'F';
    }
    public static void Main()
    {
        Console.WriteLine("enter your mark, out of 10: ");
        int mark = Convert.ToInt32(Console.ReadLine());
        if (mark >= 0 && mark <= 100)
            Console.WriteLine("your grade is : "+getGrade(mark));
        else Console.WriteLine("invalid entry");
    }
}

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