|
What will the expression give us if flour is 2 and sugar is 0? A good answer might be:The whole expression will be false, because && combines two falses into false.
|
Try out the Cookie Calculator
Here is a version of the cookie program. It is written in JavaScript so the input is from the web browser window, not from the DOS window. The statements in the true branch and the false branch are are for JavaScript (not for Java), and won't work in your Java programs. They put characters into a "text box" in the browser window. Try the program out with various values of flour and sugar to check that you understand how AND works. |
QUESTION 6:Try the program with exactly enough flour and sugar. Does the program work? Click Here after you have answered the question |