コード例 #1
0
ファイル: Program.cs プロジェクト: sophie-greene/Csharp
        static void Main(string[] args)
        {
            Random r = new Random();

            Student Student1 = new Student("Paul", "M");

            for (int i = 0; i < 5; i++)
            {
                Student1.Grades.Push(r.Next(60, 100));
            }

            Student Student2 = new Student("John", "L");

            for (int i = 0; i < 5; i++)
            {
                Student1.Grades.Push(r.Next(60, 100));
            }
            Student Student3 = new Student("George", "H");

            for (int i = 0; i < 5; i++)
            {
                Student1.Grades.Push(r.Next(60, 100));
            }

            Course Course = new Course("Programming with C#");

            Course.Students.Add(Student1);
            Course.Students.Add(Student2);
            Course.Students.Add(Student3);


            Teacher Teacher = new Teacher("Ringo", "S");

            Course.Teachers.Add(Teacher);

            Degree Degree = new Degree("Bachelor of Science");

            Degree.Course = Course;

            Degree.Course = Course;
            UProgram UProgram = new UProgram("Information Technology");

            UProgram.Degree = Degree;

            //Console.WriteLine("{0} program contains {1} degree", UProgram.UProgramName, UProgram.Degree.DegreeName);
            //Console.WriteLine("{0} degree contains {1} course", Degree.DegreeName, Degree.Course.CourseName);
            //Console.WriteLine("{0} course contains {1} students", Course.CourseName, Course.Students.Count);

            Course.ListStudents();
            Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: sophie-greene/Csharp
        static void Main(string[] args)
        {
            Random r = new Random();

            Student Student1 = new Student("Paul", "M");

            for (int i = 0; i < 5; i++) {
                Student1.Grades.Push(r.Next(60, 100));
            }

            Student Student2 = new Student("John", "L");
            for (int i = 0; i < 5; i++) {
                Student1.Grades.Push(r.Next(60, 100));
            }
            Student Student3 = new Student("George", "H");
            for (int i = 0; i < 5; i++) {
                Student1.Grades.Push(r.Next(60, 100));
            }

            Course Course = new Course("Programming with C#");
            Course.Students.Add(Student1);
            Course.Students.Add(Student2);
            Course.Students.Add(Student3);

            Teacher Teacher = new Teacher("Ringo", "S");

            Course.Teachers.Add(Teacher);

            Degree Degree = new Degree("Bachelor of Science");

            Degree.Course = Course;

            Degree.Course = Course;
            UProgram UProgram = new UProgram("Information Technology");
            UProgram.Degree = Degree;

            //Console.WriteLine("{0} program contains {1} degree", UProgram.UProgramName, UProgram.Degree.DegreeName);
            //Console.WriteLine("{0} degree contains {1} course", Degree.DegreeName, Degree.Course.CourseName);
            //Console.WriteLine("{0} course contains {1} students", Course.CourseName, Course.Students.Count);

            Course.ListStudents();
            Console.ReadLine();
        }