Explain what a range check is and provide an example.

What will be an ideal response?

When you use a range check, you compare a variable to a series of values that mark the limiting ends of ranges. To perform a range check, make comparisons using either the lowest or highest value in each range of values.

An example would be: You can ask: Is itemQuantity less than 11? If not, is it less than 25? If not, is it less than 51? (If it's possible the value is negative, you would also check for a value less than 0 and take appropriate action if it is.)

Computer Science & Information Technology

You might also like to view...

A comment is a note that an author or reviewer adds to a document

Indicate whether the statement is true or false

Computer Science & Information Technology

Given the statement: Algorithm A requires time proportional to f(n) Algorithm A is said to be ______.

a) in class f(n) b) of degree f(n) c) order f(n) d) equivalent to f(n)

Computer Science & Information Technology