• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem with Double!!!!!!

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, I cant seem to get this working I know its something small,


Thanks loads in advance joe Kane..
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Pls excuse the code,
Here is the code:

Thank joe Kane
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
notice that here:

choice1 = JOptionPane.showInputDialog("Enter Grade 1");


you are initializing choice1, but here:

while (choice == null){


you are testing choice
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic