Which of the following if statements, correctly evaluates for whether a variable
ID: 3938402 • Letter: W
Question
Which of the following if statements, correctly evaluates for whether a variable's value, called valueA, is less or equal than valueB's value, and, either valueC is bigger than 3 or valueD is equal to the word "smurf".
A. if( valueA < valueB && ( valueC > 3 || valueD == "smurf") )
B. if( valueA <= valueB && ( valueC > 3 || valueD == "smurf") )
C. if( valueA <= valueB || ( valueC > 3 && valueD == 'smurf') )
D. if( valueA <= valueB && ( valueC > 3 || valueD = 'smurf') )
Explanation / Answer
Answer :
Which of the following if statements, correctly evaluates for whether a variable's value, called valueA, is less or equal than valueB's value, and, either valueC is bigger than 3 or valueD is equal to the word "smurf".
A. if( valueA < valueB && ( valueC > 3 || valueD == "smurf") )
B. if( valueA <= valueB && ( valueC > 3 || valueD == "smurf") )
C. if( valueA <= valueB || ( valueC > 3 && valueD == 'smurf') )
D. if( valueA <= valueB && ( valueC > 3 || valueD = 'smurf') )
Answer :
B. if( valueA <= valueB && ( valueC > 3 || valueD == "smurf") )
Explanation :
valueA, is less or equal than valueB's value
ValueA <= ValueB
valueC is bigger than 3 or valueD is equal to the word "smurf".
ValueC > 3 || ValueD=="smurf"
If Statement :
valueA, is less or equal than valueB's value, and, either valueC is bigger than 3 or valueD is equal to the word "smurf".
if( valueA <= valueB && ( valueC > 3 || valueD == "smurf") )
This is the correct if statement for given statements.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.