예제 #1
0
파일: Program.cs 프로젝트: sempf/CSharp2012
 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
파일: Program.cs 프로젝트: sempf/CSharp2012
 // Init -- Tie the student to the course.
 public void Init(Student student, string courseID)
 {
     this._student = student;
     this._courseID = courseID;
 }