• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Need help with a small program.

 
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:

 
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!