So, I am trying to test my if else with two Character.toUpperCase answers and I keep getting this error: 1 error found
Error: bad operand types for binary operator '^'
first type: char
second type: boolean
I tried && and & and it won't work. If I don't use anything except an else, when the user inputs yes for the first if, it skips everything and goes straight for this else, but not for my second if statement. Second if statement works perfectectly even when I have just the else statement instead of an if else. So, I don't know exactly what to do.
This is the portion of the program that it's giving me that error:
else
if(Character.toUpperCase(onlineTrade) & Character.toUpperCase(brokerAssisted) != 'Y')
{
System.out.printf("\nInvalid Entry! Exiting program.");
anotherStock = 'N';
invalidTrade = true;
stockPurchases = "";
}
if(anotherStock != 'N')
{
System.out.printf("\nDo you want to process another Trade? Enter 'Y' or 'N': ");
anotherStock = input.nextLine().charAt(0);
}
if(invalidTrade = true)
{
anotherPerson = 'N';
}