Ask Question

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.

+1
Answers (1)
  1. 2 March, 04:45
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers