Ask Question
1 September, 22:08

Assume the existence of a class RangeException, with a constructor that accepts minimum, maximum and violating integer values (in that order). Write a function, void verify (int min, int max) that reads in integers from the standard input and compares them against its two parameters. As long as the numbers are between min and max (inclusively), the function continues to read in values. If an input value is encountered that is less than min or greater than max, the function throws a RangeException with the min and max values, and the violating (i. e. out of range) input.

+5
Answers (1)
  1. 2 September, 00:47
    0
    void verify (int min, int max)

    {

    int input;

    cin >> input;

    while (input min)

    {cin >> input;

    if (input > max || input < min)

    {throw RangeException (min, max, input);

    }}}
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume the existence of a class RangeException, with a constructor that accepts minimum, maximum and violating integer values (in that ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers