HazeyJosh / IT2105

0 stars 0 forks source link

IT2105_Seatwork1_FERRER #1

Open HazeyJosh opened 2 hours ago

HazeyJosh commented 2 hours ago

using System;

public class HelloWorld { public static void Main(string[] args) { Console.WriteLine ("Enter grades for each subject: "); Console.Write ("English: "); float english = Convert.ToInt32(Console.ReadLine());

    Console.Write ("Math: ");
    float math = Convert.ToInt32(Console.ReadLine());

    Console.Write ("Science: ");
    float science = Convert.ToInt32(Console.ReadLine());

    Console.Write ("MAPEH: ");
    float mapeh = Convert.ToInt32(Console.ReadLine());

    float total = english + math + science + mapeh;
    float ave = total/4;
    float result = ave;
    Console.Write("Average Grade: "+result);
    Console.WriteLine();

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

    }
}
HazeyJosh commented 2 hours ago

image