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.2 Expressions-WE1-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.2.1
Given
int alpha, beta = 1, gamma;
double omega = 2.5, theta, lambda;
Exercises Exercises
1.
Q1: alpha = beta;
valid
invalid
2.
Q2: alpha = omega;
valid
invalid
3.
Q3: theta = 22;
valid
invalid
4.
Q4: omega = gamma;
valid
invalid
5.
Q5: theta = lambda;
valid
invalid
You have attempted
of
activities on this page.