if (key != NO_KEY){
while ( i <= 3){
switch (i){
case 1:
digitOneChar = key; i++;
break;
case 2:
digitTwoChar = key; i++;
break;
case 3:
digitThreeChar = key; i++;
break;
}
}
If there is a key, execute the while loop, and assign the same key value to all three variables. You have the while loop in the wrong place.
void getNumbers()
{
i = 0;
while(i < 3)
{
// get a key
// if there is a key,
// assign it the correct variable
}
// manipulate the variables to produce a number
}