Explain (in words) how bonuses are assigned in the following example:if(saleAmount > 1000)if(saleAmount < 2000)bonus = 100;elsebonus = 50;
What will be an ideal response?
In this example, the following bonuses are assigned:
* If saleAmount is between $1000 and $2000, bonus is $100 because both evaluated expressions are true.
* If saleAmount is $2000 or more, bonus is $50 because the first evaluated expression is true and the second one is false.
* If saleAmount is $1000 or less, bonus is unassigned because the first evaluated expression is false and there is no corresponding else.
You might also like to view...
What is any single execution of a loop referred to as?
A. A lap of the loop. B. An iteration of the loop. C. A path through the loop. D. A round in the loop.
Clicking the Save As button automatically stores a file using the original name, drive, and folder where it was previously stored.
Answer the following statement true (T) or false (F)