Recall & Review
beginner
What does the
and logical pattern check in C#?The
and pattern checks if both conditions are true. It returns true only if all parts are true.Click to reveal answer
beginner
How does the
or logical pattern work in C#?The
or pattern returns true if at least one of the conditions is true. It only returns false if all parts are false.Click to reveal answer
beginner
What is the purpose of the
not logical pattern in C#?The
not pattern reverses the condition. If the condition is true, not makes it false, and vice versa.Click to reveal answer
beginner
Given
bool a = true; and bool b = false;, what is the result of a and b?The result is
false because and requires both to be true, but b is false.Click to reveal answer
beginner
Explain the difference between
and and or logical patterns.and requires all conditions to be true to return true. or requires only one condition to be true to return true.Click to reveal answer
What does the
and logical pattern return if one condition is false?✗ Incorrect
The
and pattern returns false if any condition is false.Which logical pattern returns true if at least one condition is true?
✗ Incorrect
The
or pattern returns true if any condition is true.What does the
not logical pattern do to a true condition?✗ Incorrect
The
not pattern reverses the condition from true to false.If
a = true and b = false, what is the result of a or b?✗ Incorrect
or returns true if at least one condition is true.Which logical pattern would you use to check if both conditions are true?
✗ Incorrect
The
and pattern checks if both conditions are true.Describe how the logical patterns
and, or, and not work in C#.Think about when each pattern returns true or false.
You got /3 concepts.
Give an example of using
and and or logical patterns in a simple C# if statement.Use variables with true/false values.
You got /4 concepts.