Skip to main content\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 1.24 Expressions-WE8-P1
Subgoals for evaluating an assignment statement.
Determine resultant data type of expression
Update variable for pre operators based on side effect
Solve arithmetic equation, operator precedence
If = statement, is Left Hand Side (LHS) a variable? Check data type of copied value against data type of variable
Update variable for post operators based on side effect
Subsection 1.24.1
Given
int x = 4, y = 6;
boolean result;
What is the value of result
after each of the following?
Exercises Exercises
1.
Q52: result = x < y;
true
false
2.
Q53: result = x + 2 < y;
true
false
3.
Q54: result = x != y;
true
false
4.
5.
Q56: result = y == x;
true
false
6.
Q57: result = y == x+2;
true
false
7.
Q58: result = 7 == 7;
true
false
8.
Q59: result = 13 < 100;
true
false
9.
10.
11.
Q62: result = 13 <= 100;
true
false
12.
Q63: result = -18 < -15;
true
false
13.
Q64: result = 4.2 > 3.7;
true
false
14.
Q65: result = 13 <= 13;
true
false
15.
You have attempted
of
activities on this page.