|
|
while
loop condition is wrong:while (yesOrNo != 'Y' || yesOrNo != 'N')
'Y'
, then it still satisfies the second condition (yesOrNo != 'N'
) and so the loop will be entered.'N'
, then it will satisfy the first condition (yesOrNo != 'Y'
) and so the loop will be entered.&&
(and) instead of ||
(or).