When you are attempting to retrieve the second value continue to loop until the value you retrieve is valid for your case.
private int GetUserValue(int index)
{
var secondValueValid = false;
int secondValue;
do
{
Console.WriteLine("Please enter the value at index {0}: ", index);
if(int.TryParse(Console.ReadLine(), out secondValue))
{
secondValueValid = true;
}
else
{
Console.WriteLine("Value entered is not a whole integer, please try again.");
}
}
while(!secondValueValid)
return secondValue;
}
This will loop until the user enters a value which is an integer, in which case it will drop out of the loop and return the value entered and in your SumNumbers method all you need to do is:
private void SumNumbers()
{
int index;
int num = 0;
for (index = 1; index <= numOfInput; index++)
{
num = GetUserValue(index);
sum += num;
}
}