// Code derived from Stroustrup's PPP2 book// § 5.7 Logic errors// -and beginning on p 156#include<iostream>usingstd::cin;usingstd::cout;intmain(){cout<<"Please enter temperatures: (enter '|' to stop):\n";doublesum=0;doublehigh_temp=-1000;// initialize to impossibly lowdoublelow_temp=1000;// initialize to “impossibly high”intno_of_temps=0;for(doubletemp;cin>>temp;){// read a temp++no_of_temps;// count temperaturessum+=temp;// compute sumif(temp>high_temp)// record highhigh_temp=temp;////if(temp<low_temp)// record lowlow_temp=temp;//}cout<<"High temperature: "<<high_temp<<'\n';cout<<"Low temperature: "<<low_temp<<'\n';cout<<"Average temperature: "<<sum/no_of_temps<<'\n';}