C# Grade Caculcation using Foreach and While Loops