// Code derived from Stroustrup's PPP2 book// § 5.5.3 Error reporting// -and beginning on p 146#include<iostream>#include<stdexcept>usingstd::cout;usingstd::runtime_error;voiderror(constchar*s){throwruntime_error(s);}// calculate area of a rectangle;// return –1 to indicate a bad argumentintarea(intlength,intwidth){if(length<=0||width<=0)return-1;returnlength*width;}// calculate area within frameintframed_area(intx,inty){constexprintframe_width=2;if(x-frame_width<=0||y-frame_width<=0)return-1;returnarea(x-frame_width,y-frame_width);}intf(intx,inty,intz){intarea1=area(x,y);if(area1<=0)error("non-positive area");intarea2=framed_area(1,z);intarea3=framed_area(y,z);doubleratio=double(area1)/area3;// . . .cout<<area1<<'\n'//<<area2<<'\n'//<<area3<<'\n'//<<ratio<<'\n';returnarea3;// stub (ie, 'a temp placeholder/value/etc'; here as a return)}intmain(){intx=0;// please test out some positive values here, toointy=0;//intz=0;//intfoo=f(x,y,z);cout<<foo<<'\n';}