I get the loop, and the initial prompt for input of type int, but... what is the while loop checking with !(cin >> [variable])? I looked at cin on cplusplus.com for an explanation but I don't see it holding any value ... it looks like it's just checking the numerical value of the number entered, how would that check for a valid integer input?
int number;
.
.
.
cout<<"Please enter a number: ";
while (!(cin >> number))
{
cin.clear();
cin >> badinput;
cout <<"Input " << badinput << " is invalid, please enter a number: ";
}