aspose file tools*
The moose likes Beginning Java and the fly likes Problem with Double!!!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with Double!!!!!!" Watch "Problem with Double!!!!!!" New topic
Author

Problem with Double!!!!!!

joe kane
Greenhorn

Joined: Jan 26, 2004
Posts: 29
HI, I cant seem to get this working I know its something small,


Thanks loads in advance joe Kane..
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
some of the first things that I see is that your methods are not static at the bottom of your code, you are passing 3 values in your call to methodtotals/totals (which expects none), you are assigning the results of this method to a variable (the method is void), your methods are expecting int values instead of doubles, and the method is called totals and you are calling it as methodtotals.
The very first thing that I see when reading the code is that you do basically the same thing three times and you have the code in there three times. I would like to recommend the book Refactoring: Improving the Design of Existing Code which is an excellent book detailing how to get rid of such redunduncies.
If you solve the above problems and it still doesn't work, I will look more into it. Hope this helps
joe kane
Greenhorn

Joined: Jan 26, 2004
Posts: 29
Hi, Pls excuse the code,
Here is the code:

Thank joe Kane
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
notice that here:
choice1 = JOptionPane.showInputDialog("Enter Grade 1");

you are initializing choice1, but here:
while (choice == null){

you are testing choice
 
 
subject: Problem with Double!!!!!!