I have now completed the coding for the program and its running fine i think lol thank you for your kindness in helping me i am now writing the coding at the side i.e. the //this does that etc.
Have i got it right OR have i totally got anything wrong on the // comments that the maker of C++ wants to find my house and slap me across the face? input welcome.
Code://What to wear according to temperature program #include<iostream.h> //Allows cin and cout to be used int main( void ) //Allows starting of main program { int i=0; //This gives the command to allow the program to carry on while (i==0) //This gives the command to reinitialise the program { int temp; //allows input of temperature cout <<"Please input the temperature\n\n:"; cin >>temp; //User input //We will now prompt output messages based on user temperature input, next lines will test temperature value and prompt an adapted message. if (temp>110) //First checking for temperature not to be higher than 110 (we are assuming that it's the maximum value) { cout <<"The temperature is too high please re-enter\n\n\n"; //If so, 'cout' command will be used to send an error message } else if (temp>=90 && temp<110) //If previous condition is not validated we are cheking if the temperature is contained beetween 110 et 90 value, then prompt adapted message with 'cout'. { cout <<"Spanish Weather : Wear shorts!\n\n"; i=1; } else if (temp>=70 && temp<90) { cout <<"Ideal weather : Short sleaves are fine\n\n"; i=1; } else if (temp>50 && temp<70) { cout <<"A little chilly : Wear a light jacket\n\n"; i=1; } else if (temp>32 && temp<50) { cout <<"English weather : Wear a heavy coat\n\n"; i=1; } else if (temp>10 && temp<32) { cout <<"wrap up warm\n\n"; i=1; } else if (temp<0 && temp <10) { cout <<"Temperature below freezing stay inside\n\n"; i=1; } else if (temp<0) //Finally we test if the temperature is under 0 (we are assuming that it's the minimum value), if so we prompt an error message. { cout <<"The temperature is too low please re-enter temperture\n\n"; i=1; } else //If finally all previous test failed, we assume that it's not a valid temperature input, and send adapted message to the user. { cout <<"You haven't entered a valid temperature\n\n"; return 0; //This ends the loop from entering a key stroke } } return 0; //Ends the program. }