Exercises

Before you get started, make sure you have forked and cloned the starter code repository for the exercises. We will be focusing on the project named Classes.

  1. Open up the file, Student.cs, and update the starter code to make use of auto-implemented properties.

    Check Your Solution
  2. In Program.cs, instantiate the Student class using yourself as the student. For the NumberOfCredits give yourself 1 for this class and a GPA of 4.0 because you are a C# superstar!

    Test your new Student object with print statements. Are you able to get and set each field?

    Check Your Solution
  3. In the Classes project, create a class Course with at least three fields. Before diving into Visual Studio, try using pen and paper to work through what these might be. At least one of your fields should be a List or Dictionary, and you should use your Student class.

    Check Your Solution
  4. Using auto-implemented properties, in the SchoolPractice project, create a class Teacher with four properties: FirstName, LastName, Subject, and YearsTeaching.