Need to write c++ code that calls a function and validate the moduleCode with a do...while loop.
I ca'nt get the function to go out the loop
Pleez help
void inputAndValidate(string &moduleCode,int &numberHours)
{
string ABC111,DEF112,XYZ113;
do
{
cout << " Enter module code: ";
cin >> moduleCode;
}
while ((moduleCode!=ABC111) || (moduleCode!=DEF112) || (moduleCode!=XYZ113));
cout << " Enter number of hours: ";
cin >> numberHours;
}
int main ()
{
string moduleCode;
int numberHours;
inputAndValidate(moduleCode, numberHours);
cout << " The module code is " << moduleCode;
cout << " and the number of hours is " << numberHours << endl;
return 0;
}