aspose file tools
The moose likes Beginning Java and the fly likes My java calculator does not give the expected output ! !!? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "My java calculator does not give the expected output ! !!?" Watch "My java calculator does not give the expected output ! !!?" New topic
Author

My java calculator does not give the expected output ! !!?

Ammar Salem
Ranch Hand

Joined: Dec 29, 2007
Posts: 60
Hi, ranchers, i have been trying to make a simple java calculator,which is suppose to perform the basic Addition ,Multiplication,Subtraction,and Division, but the only result i am getting is for Addition.No other options are shown, i cant see the menu i coded.
please, i appreciate if you can have a look at my codings and comment.
thank you.
here is my code:
***************************************************

**************************************
[ January 09, 2008: Message edited by: Ammar Salem ]

****************************<br />For Some Dreams.....<br />One Lifetime Is Not Enough.<br />****************************
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

JavaRanch tip:

If you surround your posted code with code tags
it will be a lot easier for people to read your code; meaning that you will stand a better chance of someone answering your question.

You can go back and add them by clicking the link in the top post of this thread.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

Perhaps in main() you'd like to call optionSelected() to start off?


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: My java calculator does not give the expected output ! !!?
 
Similar Threads
Returning multiple values in Java
getting error while running small program
passing values from one method to other
Read input from user until an input is valid
how to read integers from keyboard?