|
Say that you enter 9 for flour and 1 for sugar. A good answer might be:flour >= 4 true sugar >= 2 false |
Logical OperatorsHere is part of the program again:
For you to have enough ingredients,
both relational expressions must be true.
This is the role of the && (and-operator) between the two
relational expressions.
The && requires that both
andflour >= 4 are true before the entire expression is true. The entire question must be true in order for the true branch to execute.sugar >= 2
The |
QUESTION 4:Look at the program. How will the monitor screen look if the user typed 6 for flour and 4 for sugar? Click Here after you have answered the question |