0
0
C Sharp (C#)programming~10 mins

Naming conventions in C# - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare a public class with the correct PascalCase naming convention.

C Sharp (C#)
public class [1] {
    // class body
}
Drag options to blanks, or click blank then click option'
Amyclass123
Bmyclass
Cmy_Class
DMyClass
Attempts:
3 left
💡 Hint
Common Mistakes
Starting class names with lowercase letters.
Using underscores in class names.
2fill in blank
medium

Complete the code to declare a private field with the correct camelCase naming convention.

C Sharp (C#)
private int [1];
Drag options to blanks, or click blank then click option'
AuserAge
BUserAge
Cuser_age
DUser_age
Attempts:
3 left
💡 Hint
Common Mistakes
Starting private fields with uppercase letters.
Using underscores in private field names.
3fill in blank
hard

Fix the error in the property name to follow C# naming conventions.

C Sharp (C#)
public string [1] { get; set; }
Drag options to blanks, or click blank then click option'
Afirst_name
BFirstName
CfirstName
Dfirstname
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores in property names.
Starting property names with lowercase letters.
4fill in blank
hard

Fill both blanks to declare a constant integer with the correct naming convention.

C Sharp (C#)
public const int [1] = 100;
private const int [2] = 200;
Drag options to blanks, or click blank then click option'
AMaxValue
BminValue
CMAX_VALUE
DMin_Value
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or PascalCase for constants.
Not using underscores between words in constants.
5fill in blank
hard

Fill all three blanks to declare a method with correct naming and parameter conventions.

C Sharp (C#)
public void [1]([2] int [3]) {
    // method body
}
Drag options to blanks, or click blank then click option'
ACalculateSum
Bref
Cnumber
Dcalculate_sum
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores in method names.
Starting parameter names with uppercase letters.
Omitting keywords like ref when needed.