What is a range check? Provide an example of a range check using a series ofif..elsestatements using the values defined below.
final double HIGH_LIM = 1000.00;final double HIGH_RATE = 0.08;final double MED_LIM = 500.00;final double MED_RATE = 0.06;final double LOW_RATE = 0.05;
What will be an ideal response?
A range check is a series of statements that determine to which of several consecutive series of values another value falls.?if(saleAmount >= HIGH_LIM)
commissionRate = HIGH_RATE;
else
if(saleAmount >= MED_LIM)
commissionRate = MED_RATE;
else
commissionRate = LOW_RATE;?Or, perhaps somewhat more efficient:?if(saleAmount < LOW_LIM)
commissionRate = LOW_RATE;
else
if(saleAmount < MED_LIM)
commissionRate = MED_RATE;
else
commissionRate = HIGH_RATE;
You might also like to view...
In the accompanying figure, Item 3 points to the ____.
A. Name box B. title bar C. Formula bar D. toolbox
A dependent cell is a cell that supplies a value to the formula in the active cell, and a precedent cell is a cell whose value depends on the value in the active cell for its result
Indicate whether the statement is true or false.
Calls to the ToString( ) method emphasize the use of ____.
A. encapsulation B. inheritance C. abstraction D. polymorphism
You can reselect a deselected object by clicking Select on the Menu bar, then clicking ____________________.
Fill in the blank(s) with the appropriate word(s).