A good answer might be:If the answer is true something extra is done. If the answer if false nothing is done. (If you are not hungry you don't buy cookies.) | |
Single-branch IfThe "cookie problem" is about whether to do something extra. The choice is about whether to add a visit to the cookie shop to your shopping trip. The following program aids the shopper in this decision. The user of the program rates various factors on a scale of 1 to 10. If the combination of hunger, aroma, and visual appeal of the cookie exceed a threshold of 15, the program recommends a purchase.
This is just like the decisions of the previous chapter, but now there is only a true branch.
| |
QUESTION 3:The user runs the program and rates hunger, appearance, and aroma as 4.5, 6.2, and 9.9, respectively. What will the program print? Click Here after you have answered the question |