C# Saved Program: beautiful-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading.Tasks;

namespace TheOnlineCompiler
{
    public enum Grades 
    { 
        F = 0, D = 1, C = 2, B = 3, A = 4
    };
    
    public class Grade : Grades
    {
        public Grades Grade { get; set; }
        
        public Grade(Grades grade)
        {
            Grade = grade
        }
        
        public bool IsPassing()
        {
            return Grade >= Grades.D
        }
    }
    
    class Program 
    {
        static void Main() 
        {
            Grades g1 = Grades.C;
            Console.WriteLine(g1);
        }
    }
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs