Ask Question
7 October, 08:37

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.

+3
Answers (1)
  1. 7 October, 11:33
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers