char xCalcChar; //a variable to store the character that we are inspecting
xCalcChar = name.charAt(nameCharAt); //do the first character inspection

// following loop(s) check for any Xs in the user name, going through each char in the user name until // it finds one. whereupon it makes the value anyXsInName equal to true.

if ((xCalcChar == 'x') || (xCalcChar == 'X')) //initial first check as xCalcChar already has a value
{
anyXsInName = true; //this indicates that there are Xs in the user's name
}

// if previous loop returns false, then ogo through the following if the length of the name is greater
//than xCalcIn and there are no Xs found

else if ((nameLength > nameCalcInt) && (anyXsInName == false))
{
do
{
nameCalcInt++; //increment the calculation integer which makes sure that the loop only runs as
//many times as the name is long
nameCharAt++; //increment the value which makes charAt take the next char in the name
xCalcChar = name.charAt(nameCharAt); //inspect the next character
if ((xCalcChar == 'x') || (xCalcChar == 'X')) //check for those Xs again
{
anyXsInName = true; //this indicates that there are Xs in the name
}
}
while ((nameLength > nameCalcInt) && (anyXsInName == false));
// preform loop until either the lenght of the name is smaller than xCalcInt or there are Xs in the
//name as returned by anyXsInName
}