133k views
1 vote
How do I fix my mistake in the code, do not give me a bs answer like “I don’t know sorry” if you do not know just move on because I will report it like I have before.

How do I fix my mistake in the code, do not give me a bs answer like “I don’t know-example-1
User Sayth
by
4.5k points

1 Answer

7 votes

The problem lies within your if statement. You're using a single equals sign when you should be using two.

if (operation == 1)

Two equal signs is a comparison operator. It checks to see if one value equals another value. In your case, its checking if operation equals 1. But, this only solves half the problem. Operation is a string and you need to compare it to a string.

if (operation == "1")

I hope this helps!

User Ernesto Ruiz
by
5.6k points