• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with a small program.  RSS feed

 
Shane Williams
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This program is supposed to ask for the operator (+ or -) then ask you for two numbers and do the math. When I run it it comes up- Enter operator. When I say add or sub nothing happens. Can you please help?

Here it is:

 
Charles D. Ward
Ranch Hand
Posts: 99
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shane,
You can't compare strings with == . Use the equals() method instead.
 
Shane Williams
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charles D. Ward wrote:Hi Shane,
You can't compare strings with == . Use the equals() method instead.


Thanks so much! (Best forum ever )
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!