1) You should learn to modularize your code right away. If you find that you are repeating a block of similar code more than once you should move it into its own function.
ValidateUserEntryValue(a);
ValidateUserEntryValue(b);
ValidateUserEntryValue(c);
ValidateUserEntryValue(d);
void ValidateUserEntryValue(int value)
{
if( value <= 100 )
{
cout<< "your score is = "<<value<<endl;
}
else
{
cout<<"ERROR INTEGER MUST BE BETWEEN 1-100 \n"<<value<<endl;
}
}
2) You do check to ensure that the value entered is within the correct range, but you do not ensure that the value is actually an integer. I believe your program as it is written will simply crash if the user enters something that doesn't automatically convert to an integer. To do that you should run a make use of the
TryParse[
^] method provided for you by the dotNet framework.
3) At this point you just have to write the logic to calculate your mean while ignoring bad values. That part I'm leaving for you because you haven't written anything to do that yet.
Cheers.