int GetNonNegativeInteger (){ int input; cin >> input; while (input < 0) { // display error message. // ask for input again } return input;}