示例#1
0
 public static void Main(string[] strings)
 {
     // Create a student.
     Student student = new Student();
     student.Init("Stephen Davis", 1234);
     // Now enroll the student in a course.
     Console.WriteLine
            ("Enrolling Stephen Davis in Biology 101");
     student.Enroll("Biology 101");
     // Display student course.
     Console.WriteLine("Resulting student record:");
     student.DisplayCourse();
     // Wait for user to acknowledge the results.
     Console.WriteLine("Press Enter to terminate...");
     Console.Read();
 }
示例#2
0
 // Init - Tie the student to the course.
 public void Init(Student student, string courseID)
 {
   _student = student;   // 'this' not needed.
   _courseID = courseID; // Names are distinct.
 }
示例#3
0
 // Init -- Tie the student to the course.
 public void Init(Student student, string courseID)
 {
     this._student = student;
     this._courseID = courseID;
 }