Skip to main content
Contents
Dark Mode Prev Up Next Scratch ActiveCode Profile
\(
\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 3.3 Writing Expression Statements - WE1-P2
Subsection 3.3.1
To correctly write selection statements, you must write the conditional expressions correctly. To do this, you generally need to translate the requirements, written in English, to a correct boolean expression. Below are practice questions for this skill.
Subsection 3.3.2
Exercises Exercises
1.
Q1: Which of the following is the correct Java expression that is equivalent to the English expression βweight is greater than 100β?
weight > 100
weight<100
weight >= 100
weight >> 100
2.
Q2: Which of the following is the correct Java expression that is equivalent to the English expression βa not equal to 0β?
a NOT EQUAL 0
a NOT= 0
a != 0
a !== 0
3.
Q3: Which of the following is the correct Java expression that is equivalent to the English expression βapple and orange are not the sameβ?
4.
Q4: Which of the following is the correct Java expression that is equivalent to the English expression βnot doneβ?
NOT done
!= done
!done
done = false
You have attempted
of
activities on this page.