Good day,
I am trying to use this method but the literals "add", "subtract" or "divide" are not stopping the while loop from iterating. Why? Is there a better or correct way of doing this? Many thanks.
public String getOperation()
{
String operatorSelect = Dialog.request("Please input add, subtract or multiply");
while(!operatorSelect.equals("add") || !operatorSelect.equals("subtract") || !operatorSelect.equals("multiply"))
{
Dialog.alert("This is not a valid operator, please try again");
operatorSelect = Dialog.request("Please input add, subtract or multiply");
}
return operatorSelect;
}