When feedback reports a problem in C# code, avoid changing the first statement that catches your eye.
Begin by identifying the kind of issue being described.
At this stage of the course, useful categories include:
Once you understand the category, you can inspect the correct part of the program.
If the feedback seems completely unrelated to what you see in Visual Studio, verify the file itself.
Ask:
This simple check prevents a lot of unnecessary code editing.
Suppose the model requires one Player object:
player1 : Player
A corresponding introductory C# statement might be:
Player player1 = new Player();
If the source does not create the required object, compare the current statement with the model and requirement.
Common differences include:
new;Correct the specific object-creation difference rather than rewriting the entire method.
Suppose the required state includes:
name = "Jordan"
jerseyNumber = 7
The C# source might contain:
player1.name = "Jordan";
player1.jerseyNumber = 17;
The object exists.
The field exists.
One value differs.
That is a much smaller problem than “the Player code is wrong.”
Change the evidence-supported value and leave unrelated working statements alone.
A new object may exist without all required scenario values.
For example:
Player player1 = new Player();
player1.name = "Jordan";
If the current requirement also needs a jersey number, the object is incomplete for that snapshot.
Return to the UML or specification and identify which required value has not been assigned.
The model helps you distinguish a missing state value from a missing object.
If the code does not build, the compiler is telling you that the current source cannot be translated successfully.
If the code builds but the Feedback System reports that a required value is wrong, the program may be syntactically valid while still failing the requirement.
Keep those questions separate:
Build evidence: Can the current source compile?
Requirement evidence: Does the current source represent or perform what the activity requires?
A successful build does not prove the second question.
If the source appears correct but the runtime object does not contain the expected value, use a breakpoint to inspect the actual object.
For example, if you expect:
player1.jerseyNumber = 7
pause after the assignment and inspect the Player object.
If the debugger shows 7, that supports your understanding of the runtime state.
If it shows something else, find the statement that actually produced or later changed the value.
This is more reliable than guessing from the final screen alone.
A productive correction cycle is:
If the feedback changes, that new message represents the current artifact.
Do not keep correcting an old message after the underlying issue has already changed.
At this stage, an object-creation problem should not require:
If a correction seems to require a concept that has not been taught yet, return to the current requirement and supplied project.
There is usually a simpler correction within the current teaching boundary.
The strongest goal is not:
Make the system accept my submission.
It is:
Understand how the submitted code differs from the required program state and make a focused correction.
That habit becomes increasingly important as programs grow larger and the feedback becomes more complex.