Question: C++ PROGRAMMING: PLEASE MAKE SURE THE PROGRAM COMPILES AND RUNS FOR 5 STARS :-) HERE IS THE CODE TO EDIT BELOW (PLEASE ONLY ADD CODE):
C++ PROGRAMMING: PLEASE MAKE SURE THE PROGRAM COMPILES AND RUNS FOR 5 STARS :-)

HERE IS THE CODE TO EDIT BELOW (PLEASE ONLY ADD CODE):
#include#include using namespace std; class DimError { private: string message; public: //implement the methods }; class Rectangle { private: int length, width; public: //implement the methods }; int main(void) { Rectangle r; try { while (true) { int l, w; cout > l; cout > w; r.setLength(l); r.setWidth(w); cout objectives: 1. Handling exceptions within a pro 2. Using trylcatch block 3. Creating exception class Question: Design a program that repeatedly asks for the dimensions (length and width of a rectangle and computes the area. Consider a class Rectangle which includes the following two functions: void Rectangle setWidth (int width) void Rectangle setLength (int length) If the length and width are positive, then above functions store the values in the Rectangle object. However, if the length and width are negative, the functions throw an object of Dim.Error class that includes a message indicating which method was called and the reason for the error. Note: DimError class is used by the Rectangle class for showing error messages
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
