Intro the Computer

read the slides and you can read the book. just log in to brytewave. And do the assignment

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

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

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER