You are viewing a single comment's thread. Return to all comments →
List finalGrades = new();
foreach(int val in grades){ if(val < 38){ finalGrades.Add(val); }else{ int roundedGrade = (int)Math.Ceiling((decimal)val /5) *5; //Console.WriteLine($"round = {roundedGrade}"); //Console.WriteLine($"val = {val}"); //Console.WriteLine($"condition = {roundedGrade - val}"); if((roundedGrade - val) < 3){ finalGrades.Add(roundedGrade); }else{ finalGrades.Add(val); } } } return finalGrades;
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
List finalGrades = new();