static void Main(string[] args)
        {
            Student[] students = new Student[3];
            Teacher   teacher  = new Teacher();
            Course    course   = new Course(students.Length, "Programming with C#");

            course.setTeacher(teacher);
            for (int i = 0; i < students.Length; i++)
            {
                course.setStudents(students[i]);
            }

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

            degree.setCourseObject(course);

            UProgram uprogram = new UProgram();

            uprogram.uProgramName = "Information Technology Program";
            uprogram.degree_uprog = degree;

            Console.WriteLine("The {0} contains the {1}\n", uprogram.uProgramName, uprogram.degree_uprog.getDegreeName());
            Console.WriteLine("The {0} contains the course {1}\n", degree.getDegreeName(), degree.courseObject.courseName);
            Console.WriteLine("The {0} contains {1} student(s)", degree.courseObject.courseName, Course.i);
        }
        static void Main(string[] args)
        {
            //Creating Three Students
            Student manash = new Student("Manash", "Mandal", "1203043");
            Student tomal  = new Student("Mostaque Fahad", "Joarder", "1203042");
            Student ishfaq = new Student("Ishfaq Bin Rafiq", "Chowdhury", "1203040");


            //Adding Grades
            for (int i = 0; i < 5; i++)
            {
                manash.addGrade((float)i);
                tomal.addGrade((float)(i + .1));
                ishfaq.addGrade((float)(i + .2));
            }


            //Creating ArrayList
            ArrayList students = new ArrayList();

            students.Add(manash);
            students.Add(tomal);
            students.Add(ishfaq);


            //Adding Teacher
            Teacher teacher = new Teacher();

            //Course with argument ArrayList
            Course course = new Course(students, "Programming with C#");

            course.setTeacher(teacher);


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

            degree.setCourseObject(course);

            UProgram uprogram = new UProgram();

            uprogram.uProgramName = "Information Technology Program";
            uprogram.degree_uprog = degree;

            Console.WriteLine("The {0} contains the {1}\n", uprogram.uProgramName, uprogram.degree_uprog.getDegreeName());
            Console.WriteLine("The {0} contains the course {1}\n", degree.getDegreeName(), degree.courseObject.courseName);
            Console.WriteLine("The {0} contains {1} student(s)", degree.courseObject.courseName, Student.studentCount);


            course.ListStudents();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //Creating Three Students
            Student manash = new Student("Manash", "Mandal", "1203043");
            Student tomal  = new Student("Mostaque Fahad", "Joarder", "1203042");
            Student ishfaq = new Student("Ishfaq Bin Rafiq", "Chowdhury", "1203040");


            //Adding Grades at Random
            for (int i = 0; i < 5; i++)
            {
                manash.addGrade((float)i);
                tomal.addGrade((float)(i + .1));
                ishfaq.addGrade((float)(i + .2));
            }

            //Creating Generic List and adding students
            List <Student> generic_student_list = new List <Student>();

            generic_student_list.Add(manash);
            generic_student_list.Add(tomal);
            generic_student_list.Add(ishfaq);



            //Adding Teacher
            Teacher teacher = new Teacher();

            //Course with argument ArrayList
            Course course = new Course(generic_student_list, "Programming with C#");

            //Setting Course Teacher
            course.setTeacher(teacher);

            //Creating Degree Object
            Degree degree = new Degree("Bachelor of Science Degree");

            degree.setCourseObject(course);

            //Uprogram Object
            UProgram uprogram = new UProgram();

            uprogram.uProgramName = "Information Technology Program";
            uprogram.degree_uprog = degree;

            //Calling List Students Method
            course.ListStudents();
        }