Explore BrainMass

Done in vb.net, just make this basic

The MiniCalc application was designed to perform basic math calculations: +, -, *, /. However, in its present form, this application needs some improvements.

1. Test all operators with the values 8 and 2 to make sure it works as expected.

2. Test the program with 99999 + 99999. This should raise a 'System.OverflowException' exception.

3. Test the program with '9 divide 0'. The result shows 'infinity'. Actually, the calculation should raise an exception 'System.DivideByZeroException'. Modify the program so that the user input is validated before the divide operation is performed. For a divide by zero, modify the program to raise an exception, then add the code to handle the exception.

4. Now test the '-' operator using the following test cases: (1) variable1 = 32000 and variable2 = -767 and (2) variable1 = 32000 and variable2 = -768. For the first test case, the result should be 32767. For the second test case, you should get an exception.
In a Word document, write 2 paragraphs explaining what is different from the first case and fix the problem to handle the exception.

© BrainMass Inc. brainmass.com June 23, 2018, 11:41 pm ad1c9bdddf


Solution Preview

In case (4), in the first test case, the subtraction is performed OK, whereas in the second test case, a ...