Example #1
0
        static void Main(string[] args)
        {
            //Task 2

            // In this exercise you are asked to program three simple classes which keep track of the grading of a sample student.
            // The classes are called FirstCourse, SecondCourse, and Project.
            // A FirstCourse encapsulates a course name and a registration of passed / not passed for our sample student.
            // A SecondCourse encapsulates a course name and the grade of the student.
            // For grading we use the grades, numerical grades 10, 9, 8, 7, 6, 5.
            // You are also welcome use the enumeration.The grade 6 is the lowest passing grade.
            // In both FirstCourse and SecondCourse you should write a method called Passed.
            // The method is supposed to return whether our sample student passes the course.
            // The class Project aggregates two FirstCourse courses and two SecondCourse courses.
            // You can assume that a project is passed if at least three out of the four courses are passed.
            // Write a method Passed in class Project which implements this passing policy.
            // In Main method initialize 2 FirstCourse objects, 2 SecondCourse objects and 1 Project object.
            // Add both FirstCourse and both SecondCourse objects like a properties to Project object.
            // Call Project's object Passed method to see if the student passed.

            FirstCourse  course1 = new FirstCourse("C# Basic", true);
            FirstCourse  course2 = new FirstCourse("C# Advanced", true);
            SecondCourse course3 = new SecondCourse("JS Bacis", Grades.five);
            SecondCourse course4 = new SecondCourse("JS Advanced", Grades.five);
            Project      project = new Project(course1, course2, course3, course4);

            project.Passed();
        }
Example #2
0
 public Project(FirstCourse course1, FirstCourse course2, SecondCourse course3, SecondCourse course4)
 {
     Course1 = course1;
     Course2 = course2;
     Course3 = course3;
     Course4 = course4;
 }
Example #3
0
        static void Main(string[] args)
        {
            //PhotoAlbum myAlbum1 = new PhotoAlbum();
            //myAlbum1.GetNumberOfPages();

            //PhotoAlbum myAlbum2 = new PhotoAlbum(24);
            //myAlbum2.GetNumberOfPages();

            //BigPhotoAlbum myAlbum3 = new BigPhotoAlbum();
            //myAlbum3.GetNumberOfPages();

            // TASK 02........................................................................

            var firstCourseOne = new FirstCourse("SEDC", true);
            var firstCourseTwo = new FirstCourse("SEDC", true);

            var secondCourseOne = new SecondCourse("SEDC", StudentGrades.Seven);
            var SecondCourseTwo = new SecondCourse("SEDC", StudentGrades.Six);

            Project Grades = new Project(firstCourseOne.Passed(), firstCourseTwo.Passed(), secondCourseOne.Passed(), SecondCourseTwo.Passed());

            Grades.Passed();

            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            var firstCourse  = new FirstCourse("JS", Grades.grade5);
            var secondCourse = new FirstCourse("Angular", Grades.grade7);
            var thirdCourse  = new SecondCourse("C#", Grades.grade10);
            var fourthCourse = new SecondCourse("React", Grades.grade5);

            Project FirstProject = new Project();

            bool[] gradesToBool = { firstCourse.hasPassed(), secondCourse.hasPassed(), thirdCourse.hasPassed(), fourthCourse.hasPassed() };

            FirstProject.PassedTheAcademy(gradesToBool);


            Console.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            var firstCourseOne  = new FirstCourse("C#", true);
            var firstCourseTwo  = new FirstCourse("JS", false);
            var secondCourseOne = new SecondCourse("HTML", studentGrade.Bad);
            var secondCourseTwo = new SecondCourse("CSS", studentGrade.Excellent);
            var newProject      = new Project()
            {
                first1  = firstCourseOne,
                first2  = firstCourseTwo,
                second1 = secondCourseOne,
                second2 = secondCourseTwo
            };

            newProject.Passed(
                firstCourseOne.Passed(firstCourseOne.Registration),
                firstCourseTwo.Passed(firstCourseTwo.Registration),
                secondCourseOne.Passed(secondCourseOne.Grade),
                secondCourseTwo.Passed(secondCourseTwo.Grade)
                );

            Console.ReadLine();
        }