Hi am writing code for the calculator for add subtract divide and multiply.
on three of the lines it says expected expression and Idk why. can someone plz help? I woulld really appreciate it. Thanks so much in advance!! error is displayed on lines 15, 18 , and 21
You aren't using the correct operator to assign the value to response. You should use the assignment operator for this. You are also using a string, so arithmetic operators won't work (except '+' because it has been overloaded). You'll have to use two integers and a character if you want to make a calculator like this.
Your error comes from the lack of braces. You need braces if your condition has more than one statement associated with it. So, line 13 is part of the if condition, but line 14 isn't, and happens no matter what. Line 15 is else if, which can only happen after an if, so your compiler has issue.