// Code derived from Stroustrup's PPP2 book// § 5.5.3 Error reporting// -and beginning on p 145#include<iostream>#include<string>usingstd::cin;usingstd::cout;usingstd::string;// ask user for a yes-or-no answer;// return 'b' to indicate a bad answer (i.e., not yes or no)charask_user(stringquestion){cout<<question<<"? (yes or no)\n";stringanswer=" ";cin>>answer;if(answer=="y"||answer=="yes")return'y';if(answer=="n"||answer=="no")return'n';return'b';// ‘b’ for “bad answer”}// calculate area of a rectangle;// return –1 to indicate a bad argumentintarea(intlength,intwidth){if(length<=0||width<=0)return-1;returnlength*width;}intmain(){conststringquestion="Are all x of y?";charanswer=ask_user(question);//---inty=0;// please test out some positive values here, toointz=0;//intarea1=area(y,z);//---cout<<answer<<'\n'//<<y<<'\n'//<<z<<'\n'//<<area1<<'\n';}