Reference no: EM132154692
Update:: Please do it from scratch there is no code available.
Please use C++ Language. And please provide comment about your codes thanks.
GeometricArea.cpp and SpecificationException.cpp
Requested files: GeometricArea.cpp, SpecificationException.h, SpecificationException_test.cpp (Download)
Maximum number of files: 4
Type of work: Individual work
Extend the GeometricArea.cpp program you wrote to use an exception to handle user input where the parameters entered do not meet specifications, or that simply don't make sense. In the case of GeometricArea this occurs when the number of sides is two (2).
You should create a class SpecificationException that is thrown whenever your program encounters a specification that does not make sense. For example, if your program is asked to compute the area of a 2 sided polygon, You should throw a SpecificationException, because the fewest number of sides a polygon can have is 3..
You can create this class using only an interface (or header) file called SpecificationException.h. Simply include this header file in your GeometricArea.cpp source code and you can use that exception object..
The test driver for this program is named SpecificationException_test.cpp because it is supposed to call GeometricArea functions with values that trigger an exception.