Answer:
This code is written using C++
Comments are used for explanatory purpose
Program starts here
#include<iostream>
using namespace std;
int main() {
int temp;
//Prompt user for input
cout<<"Enter temperature (in Celcius): ";
//Check if input is acceptable
while(!(cin>>temp)) {
cout << "That was invalid. Enter a valid digit: "<<endl;
cin.clear(); // reset the failed input
cin.ignore(123,'\\');//Discard previous input
}
//Check if temp is greater than 40
if(temp>40) {
cout<<"It's extremely hot day today!";
}
else{//If otherwise
cout<<"It's not too hot!";
}
return 0;
}
//End of Program