public student(int myshnat, int mytz, string myname) { shnatl = myshnat; tz = mytz; name = myname; // Random myRandom = new Random(); int courses = myRandom.Next(4, 6); Node <grade> currg = null; Node <grade> nextg = null; for (int i = 0; i < courses; i++) { grade g = new grade(myRandom.Next(10, 20), myRandom.Next(60, 100)); nextg = new Node <grade>(g, null); if (currg != null) { currg.SetNext(nextg); } currg = nextg; if (i == 0) { grades = currg; } } }
public void printGrades() { Node <grade> gd = this.grades; while (gd != null) { grade gd1 = gd.GetValue(); Console.WriteLine(gd1.getCourseStr()); gd = gd.GetNext(); } }