The fault is in your logic... this logic means that it would have to equals "add", "subtract", and "multiply" at the same time for the loop to terminate (impossible). Instead, you should use and...