LaunchCodeEducation / csharp-web-dev-curriculum

Hugo version of C# Unit 2
http://education.launchcode.org/csharp-web-dev-curriculum/
1 stars 5 forks source link

Chapter 4 Exercises step 1 confusing wording #61

Closed matthewcreek closed 3 months ago

matthewcreek commented 3 months ago

Relevant Link

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

Check your solution provides the following code:


{
private static int nextStudentId = 1;
public string Name { get; set; }
public int StudentId { get; set; }
public int NumberOfCredits { get; set; } = 0;
public double Gpa { get; set; } = 0.0;
  public Student(string name, int studentId, int numberOfCredits, double gpa)
  {
     Name = name;
     StudentId = studentId;
     NumberOfCredits = numberOfCredits;
     Gpa = gpa;
  }

  public Student(string name, int studentId): this(name, studentId, 0, 0) { }

  public Student(string name): this(name, nextStudentId)
  {
     nextStudentId++;
  }

}



Suggested change: The task given alludes to writing code for only a single part of a class, leading to confusion on how step 2 relates to step 1. Would revise step 1 to say something along the lines of "1. Open up the file, Student.cs, and update the starter code to make use of auto-implemented properties as well as the class constructors needed."
matthewcreek commented 3 months ago

noting elsewhere