示例#1
0
        public static void DisplayEnrollments(Enroll enroll)
        {
            AppEngine appEngine = new AppEngine();

            Console.WriteLine("List of enrollments are {0}", appEngine.ListOfEnrollments());
        }
示例#2
0
        static void Main()
        {
            AppEngine appEngine = new AppEngine();
            //adding courses
            //Console.WriteLine("enter no. of courses");
            //int cnum = Convert.ToInt32(Console.ReadLine());
            Course course;

            for (int i = 0; i < 5; i++)
            {
                string name = Console.ReadLine();
                Console.WriteLine("enter course id");
                int id = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter course duration");
                int duration = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter course fees");
                float fees;
                float.TryParse(Console.ReadLine(), out fees);
                course = new Course(name, id, duration, fees);
                appEngine.Introduce(course);
            }
            //adding students
            Console.WriteLine("enter no. of students registered");
            int     snum = Convert.ToInt32(Console.ReadLine());
            Student student;

            for (int i = 0; i < snum; i++)
            {
                Console.WriteLine("enter students name");
                string name = Console.ReadLine();
                Console.WriteLine("enter students id");
                int id = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter students dob");
                DateTime Dob = Convert.ToDateTime(Console.ReadLine());
                student = new Student(name, id, Dob);
                appEngine.Register(student);
            }
            //enrollment
            Console.WriteLine("enter no. of students to be enrolled");
            int eno = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < eno; i++)
            {
                Console.WriteLine("enter course name");
                string cname = Console.ReadLine();
                Console.WriteLine("enter course id");
                int cid = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter course duration");
                int duration = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter course fees");
                float fees;
                float.TryParse(Console.ReadLine(), out fees);
                course = new Course(cname, cid, duration, fees);
                Console.WriteLine("enter students name");
                string name = Console.ReadLine();
                Console.WriteLine("enter students id");
                int id = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("enter students dob");
                DateTime Dob = Convert.ToDateTime(Console.ReadLine());
                student = new Student(name, id, Dob);
                course  = new Course(cname, cid, duration, fees);
                appEngine.Enroll(student, course);
            }
        }