18.7. Exercises: Classes and ObjectsΒΆ

Before you get started, make sure you have forked and cloned the starter code.

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

  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!

  3. In the SchoolPractice 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.

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