Exemple #1
0
        static void Main(string[] args)
        {
            Course course = new Course(1, "C# Fundamentals");
              course.AddStudent(new Student(1, "John", 85, true));
              course.AddStudent(new Student(2, "Kerry", 65, true));
              course.AddStudent(new Student(3, "Luke", 45, false));
              course.AddStudent(new Student(4, "Barb", 90, true));
              course.AddStudent(new Student(5, "Peter", 100, true));

              Console.WriteLine("Students in the {0} course:", course.CourseName);
              foreach (Student student in course.Students)
              {
            Console.WriteLine("{0} finished with {1}% - Status : {2}", student.Name, student.Mark, student.PaidFees);
              }
              Console.WriteLine("{0} Total Students", course.TotalStudents);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Course course = new Course(1, "C# Fundamentals");

            course.AddStudent(new Student(1, "John", 85, true));
            course.AddStudent(new Student(2, "Kerry", 65, true));
            course.AddStudent(new Student(3, "Luke", 45, false));
            course.AddStudent(new Student(4, "Barb", 90, true));
            course.AddStudent(new Student(5, "Peter", 100, true));

            Console.WriteLine("Students in the {0} course:", course.CourseName);
            foreach (Student student in course.Students)
            {
                Console.WriteLine("{0} finished with {1}% - Status : {2}", student.Name, student.Mark, student.PaidFees);
            }
            Console.WriteLine("{0} Total Students", course.TotalStudents);
        }
Exemple #3
0
        private static void AddCoursesToList(List<Course> courses)
        {
            Course course = new Course(1, "CCTP150", "C# Fundamentals");
              course.AddStudent(new Student(1, "John", 85, true));
              course.AddStudent(new Student(2, "Kerry", 65, true));
              courses.Add(course);

              course = new Course(2, "CCTP152", "MVC Development Fundamentals");
              course.AddStudent(new Student(3, "Luke", 45, false));
              course.AddStudent(new Student(4, "Barb", 90, true));
              course.AddStudent(new Student(5, "Peter", 100, true));
              courses.Add(course);

              course = new Course(3, "CCTP154", "C# Advanced Programming");
              course.AddStudent(new Student(6, "Tom", 33, true));
              course.AddStudent(new Student(7, "Sue", 78, false));
              courses.Add(course);
        }
Exemple #4
0
        private static void AddCoursesToList(List <Course> courses)
        {
            Course course = new Course(1, "CCTP150", "C# Fundamentals");

            course.AddStudent(new Student(1, "John", 85, true));
            course.AddStudent(new Student(2, "Kerry", 65, true));
            courses.Add(course);

            course = new Course(2, "CCTP152", "MVC Development Fundamentals");
            course.AddStudent(new Student(3, "Luke", 45, false));
            course.AddStudent(new Student(4, "Barb", 90, true));
            course.AddStudent(new Student(5, "Peter", 100, true));
            courses.Add(course);

            course = new Course(3, "CCTP154", "C# Advanced Programming");
            course.AddStudent(new Student(6, "Tom", 33, true));
            course.AddStudent(new Student(7, "Sue", 78, false));
            courses.Add(course);
        }