Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare an enum named Color.
C Sharp (C#)
enum [1] { Red, Green, Blue } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase names for enums.
Using plural form when singular is expected.
✗ Incorrect
The enum name should be Color to match the declaration.
2fill in blank
mediumComplete the code to specify the underlying type of the enum as byte.
C Sharp (C#)
enum Status : [1] { Active, Inactive, Pending } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-integral types like string or bool as underlying type.
Omitting the colon before the type.
✗ Incorrect
The underlying type byte is specified after the colon in enum declaration.
3fill in blank
hardFix the error in the enum declaration by completing the code.
C Sharp (C#)
enum Days [1] Monday, Tuesday, Wednesday } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses or brackets instead of braces.
Omitting braces entirely.
✗ Incorrect
Enum members must be enclosed in curly braces { }.
4fill in blank
hardFill both blanks to declare an enum named Direction with underlying type short.
C Sharp (C#)
enum [1] : [2] { North, South, East, West }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong underlying types like int when short is required.
Using incorrect enum names.
✗ Incorrect
The enum name is Direction and the underlying type is short.
5fill in blank
hardFill all three blanks to declare an enum named Level with underlying type int and members Low, Medium, High.
C Sharp (C#)
enum [1] : [2] { [3] }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural enum names when singular is expected.
Omitting commas between enum members.
✗ Incorrect
The enum is named Level, uses int as underlying type, and has members Low, Medium, High.