Пример #1
1
        public void addStudent(string firstName, string lastName)
        {
            Student stu = new Student();
            stu.FirstName = firstName;
            stu.LastName = lastName;
            stu.CollegeID = generateStudentID();

            ReportCard reportCard = new ReportCard();

            StudentRecord.Rows.Add(stu, reportCard);
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();
            AllCourseAvailable = new List<Course>();
            AllStudents = new List<Student>();

            //////////

            Course classes = new Course();
            classes.CourseName = "Math";
            classes.CreditHours = 4;
            Course classes2 = new Course();
            classes2.CourseName = "English";
            classes2.CreditHours = 3;

            AllCourseAvailable.Add(classes);
            AllCourseAvailable.Add(classes2);
            refreshAllCourseBoxes();

            Student student1 = new Student();
            student1.FullName = "Jame Novak";
            Student student2 = new Student();
            student2.FullName = "Nate Silver";

            AllStudents.Add(student1);
            AllStudents.Add(student2);
            refreshStudentComboBox();
        }
Пример #3
0
        private void insertStudentData()
        {
            Student stu = new Student();
            stu.FirstName = "Jim";
            stu.LastName = "Bob";
            stu.CollegeID = "4444";

            ReportCard reportCard = new ReportCard();
            GradeItem gr = new GradeItem();

            gr.CourseCode = "HIS 100";
            gr.Grade = 4.0;
            reportCard.AllGrades.Add(gr);

            gr.CourseCode = "CSC 204";
            gr.Grade = 4.0;
            reportCard.AllGrades.Add(gr);

            StudentRecord.Rows.Add(stu, reportCard);
        }
Пример #4
0
        private void addOneStudent(string firstName, string lastName)
        {
            ReportCard report = new ReportCard();

            Student newStudent = new Student();
            newStudent.FirstName = firstName;
            newStudent.LastName = lastName;
            newStudent.FullName = newStudent.FirstName + " " + newStudent.LastName;
            newStudent.ReportCard = report;

            AllStudents.Add(newStudent);
        }
Пример #5
0
        private void writeReport(Student student)
        {
            string filePath = @"C:\Users\Tanya\Desktop\ReportCard.txt";

            using (StreamWriter writer = new StreamWriter(filePath))
            {
                writer.WriteLine("Report Card");
                writer.WriteLine("Name: " + student.FullName);
                writer.WriteLine();
                writer.WriteLine("Overall GPA: " + student.ReportCard.OverallGPA.ToString("0.00"));
                writer.WriteLine("--------------------");
                foreach (GradeItem item in student.ReportCard.AllGrades)
                {
                    writer.WriteLine(item.Course.CourseName.ToUpper());
                    writer.WriteLine("Credit Hours: " + item.Course.CreditHours.ToString());
                    writer.WriteLine("Class Grade: " + item.Grade.ToString("0.0"));
                    writer.WriteLine();
                }
            }
        }