Momo-html / IT2105

0 stars 0 forks source link

IT2105_Seatwork1_BAEL #1

Open Momo-html opened 1 month ago

Momo-html commented 1 month ago

// Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compiler

using System;

public class HelloWorld { public static void Main(string[] args) { Console.WriteLine("Enter Grades Below");

    Console.WriteLine("English: ");
    double eng = Convert.ToDouble(Console.ReadLine());
    Console.WriteLine("Math: ");
    double math = Convert.ToDouble(Console.ReadLine());
    Console.WriteLine("Science: ");
    double sci = Convert.ToDouble(Console.ReadLine());
    Console.WriteLine("MAPEH: ");
    double mapeh = Convert.ToDouble(Console.ReadLine());

    double sum = eng + math + sci + mapeh;
    double ave = sum / 4;

    Console.WriteLine("Average: " + ave);

    if (ave > 100)
    {
        Console.WriteLine("Invalid Grade");
    }
    else if (ave >= 98)
    {
        Console.WriteLine(" With Highest Honors");
    }
    else if (ave >= 95)
    {
        Console.WriteLine("With High Honors");
    }
    else if (ave >= 90)
    {
        Console.WriteLine("With Honors");
    }
    else if (ave >= 75)
    {
        Console.WriteLine("Passed");
    }
    else
    {
        Console.WriteLine("Failed");
    }
}

}

Momo-html commented 1 month ago

image