COMP SCI 200 Module 4 with
100% correct answers
if Statement - answer Executes a group of
statements if an expression is true.
Braces - answer Surround the if branch's
statements {}, representing a grouping, such as a
group of statements.
Equality Operator (==) - answer Evaluates to true
if the left and right sides are equal.
Inequality Operator - answer (!=) Evaluates to true
if the left and right sides are not equal or different.
Boolean - answer A type that has just two values:
true or false. An expression involving the equality
or inequality operators evaluates to a Boolean
value.
if-else Statement - answer Executes one group of
statements when an expression is true, and
another group of statements when the expression
is false.
, Comparing characters, strings, floating-point types
- answer -floating-point types should not be
compared using equality operators due to
imprecise representation of floating-point numbers
-strings--unexpected results will occur
Branch - answer A sequence of statements only
executed under a certain condition.
if-else Branch - answer Two branches-the first
branch is executed IF an expression is true, ELSE
the other branch is executed.
Logical Operator - answer Treats operands as being
true or false, and evaluates to true or false.
-a AND b: true when both of its operands are true
-a OR b: true when at least one of its two operands
are true
-NOT a: true when its one operand is false, and
vice-versa
Other Logical Operator Symbols - answer a && b:
Logical AND
a || b: Logical OR
!a : Logical NOT
100% correct answers
if Statement - answer Executes a group of
statements if an expression is true.
Braces - answer Surround the if branch's
statements {}, representing a grouping, such as a
group of statements.
Equality Operator (==) - answer Evaluates to true
if the left and right sides are equal.
Inequality Operator - answer (!=) Evaluates to true
if the left and right sides are not equal or different.
Boolean - answer A type that has just two values:
true or false. An expression involving the equality
or inequality operators evaluates to a Boolean
value.
if-else Statement - answer Executes one group of
statements when an expression is true, and
another group of statements when the expression
is false.
, Comparing characters, strings, floating-point types
- answer -floating-point types should not be
compared using equality operators due to
imprecise representation of floating-point numbers
-strings--unexpected results will occur
Branch - answer A sequence of statements only
executed under a certain condition.
if-else Branch - answer Two branches-the first
branch is executed IF an expression is true, ELSE
the other branch is executed.
Logical Operator - answer Treats operands as being
true or false, and evaluates to true or false.
-a AND b: true when both of its operands are true
-a OR b: true when at least one of its two operands
are true
-NOT a: true when its one operand is false, and
vice-versa
Other Logical Operator Symbols - answer a && b:
Logical AND
a || b: Logical OR
!a : Logical NOT