// 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(){intx=0;// please test out some positive values here, toointy=0;//if(x<=0)error("non-positive x");if(y<=0)error("non-positive y");intarea1=area(x,y);cout<<x<<'\n'//<<y<<'\n'//<<area1<<'\n';}