In: Computer Science
Using C# Design and implement a program (name it ProcessGrades) that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Sample run 1:
You entered: 95, 80, 100, 70
Highest grade:100
Lowest grade: 70
Average grade:86.25
using System; public class ProcessGrades { public static void Main(string[] args) { Console.Write("Enter first grade: "); int grade1 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter second grade: "); int grade2 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter third grade: "); int grade3 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter fourth grade: "); int grade4 = Convert.ToInt32(Console.ReadLine()); int max = grade1, min = grade1; if(grade2 > max) max = grade2; if(grade3 > max) max = grade3; if(grade4 > max) max = grade4; if(grade2 < min) min = grade2; if(grade3 < min) min = grade3; if(grade4 < min) min = grade4; Console.WriteLine("You entered: " + grade1 + ", " + grade2 + ", " + grade3 + ", " + grade4); Console.WriteLine("Highest grade: " + max); Console.WriteLine("Lowest grade: " + min); Console.WriteLine("Average grade: " + ((grade1 + grade2 + grade3 + grade4) / 4.0)); } }