Пример #1
0
        static void Main(string[] args)
        {
            // Create some cohorts, students, and instructors in your `Program.cs` and assign the students and instructors to the cohort
            Cohort Cohort26 = new Cohort();

            Student SathvikReddy = new Student("Sathvik", "Reddy");
            Student SethDana     = new Student("Seth", "Dana");

            Instructor JisieDavid    = new Instructor("Jisie", "David");
            Instructor SteveBrownlee = new Instructor("Steve", "Brownlee");

            Cohort26.InstructorList.Add(JisieDavid);
            Cohort26.InstructorList.Add(SteveBrownlee);

            Cohort26.StudentList.Add(SathvikReddy);
            Cohort26.StudentList.Add(SethDana);

            // 1. Create some exercises
            // 2. Write a method on the `Instructor` class that will allow you to assign an individual exercise to an individual student

            Exercise Loops = new Exercise();

            Loops.Name      = "For Loops";
            Loops.GitHubUrl = "www.github.com/for-loops";
            Loops.Language  = "JavaScript";

            Exercise Conditionals = new Exercise();

            Conditionals.Name      = "Conditional Statements";
            Conditionals.GitHubUrl = "www.github.com/conditionals";
            Conditionals.Language  = "C#";

            SteveBrownlee.AssignExercise(SathvikReddy, Loops);
            JisieDavid.AssignExercise(SathvikReddy, Conditionals);
            JisieDavid.AssignExercise(SethDana, Conditionals);

            // Pick one of the students and write to the Console each exercise that has been assigned to that student
            foreach (Exercise exercise in SathvikReddy.AssignedExercises)
            {
                Console.WriteLine($"{SathvikReddy.Name} has been assigned {exercise.Name} for homework tonight");
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Cohort cohort26 = new Cohort();

            Instructor steve = new Instructor("Steve", "Brownlee");

            Student jewel = new Student("Jewel", "Ramirez");


            //and assign the students and instructors to the cohort
            cohort26.InstructorList.Add(steve);
            cohort26.StudentList.Add(jewel);

            // 1. Create some exercises
            // 2. Write a method on the `Instructor`
            //class that will allow you to assign an individual exercise to an individual student

            Exercise ex1 = new Exercise();

            ex1.Name      = "ChickenMonkey";
            ex1.Language  = "JavaScript";
            ex1.GithubUrl = "www.github.com";

            Exercise ex2 = new Exercise()
            {
                Name      = "KillHanson",
                Language  = "C#",
                GithubUrl = "www.github.com"
            };

            System.Console.WriteLine(ex2.Name);

            //Pick one of the students and write to the Console each exercise that has been assigned to that student
            steve.AssignExercise(jewel, ex1);
            steve.AssignExercise(jewel, ex2);

            foreach (Exercise exercise in jewel.AssignedExercises)
            {
                Console.WriteLine($"{jewel.Name}: {exercise.Name}");
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            //Cohort refering to the file name. cohort26 = taco. Setting to a function Cohort
            Cohort cohort26 = new Cohort();

            Instructor steve = new Instructor("Steve", "Brownlee");

            Student jewel = new Student("Jewel", "Ramirez");

            // adding steve and jewel to the function??
            cohort26.InstructorList.Add(steve);
            cohort26.StudentList.Add(jewel);



            // setting exercise to new exercise
            Exercise ex1 = new Exercise();

            ex1.Name      = "ChickenMonkey";
            ex1.Language  = "JavaScript";
            ex1.GithubUrl = "www.github.com";

            Exercise ex2 = new Exercise()
            {
                Name      = "KillHanson",
                Language  = "c#",
                GithubUrl = "www.github.com"
            };

            Console.WriteLine(ex2.Name);

            steve.AssignExercise(jewel, ex2);

            foreach (Exercise exercise in jewel.AssignedExercises)
            {
                Console.WriteLine($"{jewel.Name}:{exercise.Name}");
            }
        }