Hi I am writing some code but need a validation in one part
I need it so that you cannot enter a minus value for car age or milage, im sure i know this but my mind has gone totally blank.Code:for(int i=0; i < size; i++) { system("cls"); cout <<"\nPlease enter the Cars registration: " << (i+1) << ": "; cin >> autos[i].carreg; cout <<"\nPlease enter the make of Car: "; cin >> autos[i].carmake; cout <<"\nPlease enter the Model of Car: "; cin >> autos[i].carmodel; cout <<"\nPlease enter the Cars milage: "; cin >> autos[i].carmile; cout <<"\nPlease enter the Cars age: "; cin >> autos[i].carage; cout<<"\n"; }
Thanks in advance for any help.
snooki



LinkBack URL
About LinkBacks


