You are viewing a single comment's thread. Return to all comments →
C#
class Student : Person { private readonly int _average; public Student(string firstName, string lastName, int id, int[] scores) : base(firstName, lastName, id) { _average = scores.Sum() / scores.Length; } public char Calculate() => _average switch { >= 90 => 'O', >= 80 => 'E', >= 70 => 'A', >= 55 => 'P', >= 40 => 'D', _ => 'T' }; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 12: Inheritance
You are viewing a single comment's thread. Return to all comments →
C#