Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to assign the value 10 to the variable.
C Sharp (C#)
int number = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers which makes them strings.
Using words like 'ten' instead of numeric values.
✗ Incorrect
The variable number is of type int, so it must be assigned an integer value like 10.
2fill in blank
mediumComplete the code to assign the character 'A' to the variable.
C Sharp (C#)
char letter = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using double quotes which makes it a string.
Using the character without quotes.
✗ Incorrect
Characters in C# are assigned using single quotes, like 'A'.
3fill in blank
hardFix the error in assigning a boolean value to the variable.
C Sharp (C#)
bool isActive = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase True which is invalid in C#.
Using quotes which makes it a string.
Using numbers like 1 instead of true.
✗ Incorrect
Boolean values in C# are lowercase true or false without quotes.
4fill in blank
hardFill both blanks to assign a floating-point number and a string correctly.
C Sharp (C#)
float pi = [1]f; string greeting = [2];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using comma instead of dot for decimals.
Not adding 'f' suffix for float values.
Not using quotes for strings.
✗ Incorrect
The float value must have an 'f' suffix and be a number with a dot. Strings require double quotes.
5fill in blank
hardFill all three blanks to assign an integer, a boolean, and a string correctly.
C Sharp (C#)
int count = [1]; bool isReady = [2]; string message = [3];
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around booleans.
Using words instead of numbers for integers.
Not using quotes for strings.
✗ Incorrect
Assign integer 5 directly, boolean true lowercase without quotes, and string "Done" with quotes.