// Code derived from Stroustrup's PPP2 book// § 5.5.1 The caller deals with errors// -and beginning on p 142#include<iostream>#include<stdexcept>usingstd::cout;usingstd::runtime_error;// error() simply disguises throwsvoiderror(constchar*s){throwruntime_error(s);}// calculate area of a rectangleintarea(intlength,intwidth){returnlength*width;}// calculate area within frameintframed_area(intx,inty){returnarea(x-2,y-2);}intmain(){inty=0;// please test out some positive values here, toointz=0;//if(z<=2)error("non-positive 2nd area() argument called by framed_area()");intarea2=framed_area(1,z);if(y<=2||z<=2)error("non-positive area() argument called by framed_area()");intarea3=framed_area(y,z);cout<<y<<'\n'//<<z<<'\n'//<<area2<<'\n'//<<area3<<'\n';}