read the slides and you can read the book. just log in to brytewave. And do the assignment
CSE 112 Introduction to Computer Science II
CSE 112 – Lab #6 Object Oriented Exception Handling with Classes
Ref: page 1028 – Rectangle and Program 16-2, and 16-5
Modify the Circle Class from the earlier lab to add exception handling for negative radius inputs.
Modify the main program to use a try/catch as shown below. This will require creating a NegativeRadius
class in the Circle class. The NegativeRadius class will have a constructor that receives the radius and
stores it in a member variable (value) (Ref 16.1) and has a member function getValue() that returns the
value. This chronology requires creating an instance of the circle before trying to set the radius in the try
block of main (see below). Add the loop as shown below so that multiple iterations of the program can
be run. Submit a text file with the modified main, and header file.
int main()
{
double radius = 0; // To hold a radius
char tryAgain = ‘y’;
Circle userCircle;
while(tryAgain == ‘y’ || tryAgain == ‘Y’)
{
cout > radius;
try
{
userCircle.setRadius(radius);
cout