Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a Boolean variable with the value true.
C Sharp (C#)
bool isActive = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using capitalized True instead of lowercase true.
Using numeric values like 1 instead of Boolean literals.
Using string "true" instead of Boolean literal.
✗ Incorrect
In C#, the Boolean literal for true is true in lowercase.
2fill in blank
mediumComplete the code to check if the Boolean variable is false.
C Sharp (C#)
if (isEnabled == [1]) { Console.WriteLine("Disabled"); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using capitalized False instead of lowercase false.
Using numeric 0 instead of Boolean literal.
Using True instead of false.
✗ Incorrect
The Boolean literal for false in C# is false in lowercase.
3fill in blank
hardFix the error in the code to correctly assign a Boolean value.
C Sharp (C#)
bool isReady = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using string "true" instead of Boolean literal.
Using capitalized True which is invalid in C#.
Using numeric 1 instead of Boolean literal.
✗ Incorrect
Boolean values must be assigned using lowercase true or false without quotes.
4fill in blank
hardFill both blanks to create a Boolean expression that checks if x is greater than 10.
C Sharp (C#)
bool result = (x [1] 10) [2] true;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of > for greater than.
Using != instead of == for equality check.
Omitting the comparison to true.
✗ Incorrect
The expression x > 10 == true checks if x is greater than 10.
5fill in blank
hardFill all three blanks to create a Boolean expression that checks if y is less than or equal to 5 and isActive is true.
C Sharp (C#)
bool check = (y [1] 5) [2] (isActive [3] true);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using < instead of <= for less than or equal.
Using || instead of && for logical AND.
Omitting == when comparing Boolean values.
✗ Incorrect
The expression (y <= 5) && (isActive == true) checks both conditions correctly.