In this part of PC1, you are moving from reading supplied code to writing small class definitions yourself.
The goal is not to write a complete application from memory.
The goal is to translate a clear design into readable, valid C#.
Suppose the class diagram says:
Player
-------------------------
name : string
jerseyNumber : int
The source should preserve:
A basic implementation can begin:
class Player
{
public string name;
public int jerseyNumber;
}
A useful sequence is:
class name
↓
opening and closing braces
↓
one field declaration
↓
next field declaration
↓
save
↓
build
Small steps make compiler feedback easier to interpret.
If the model says:
jerseyNumber
do not casually rename it to:
number
or:
jersey
Names create a connection between requirements, UML, and source.
Readable source:
class Player
{
public string name;
public int jerseyNumber;
}
Indentation shows that the fields belong to the class.
Style rules may enforce additional conventions, but the basic goal is clear structure.
Writing code is an iterative process:
write
↓
save
↓
build
↓
read diagnostics
↓
revise
Compiler feedback is evidence about the source you actually wrote.
The next activities make field declarations, naming, and access choices more precise.