wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes calculation methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "calculation methods" Watch "calculation methods" New topic
Author

calculation methods

nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i have been working on this program and i have gotten it almost complete. everything is working correctly except for my output on two calculations. its something like this:


i have been looking over my methods but i cant figure it out. if someone can see the problem it would be a big help.



nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i got the bulbs column fixed, but my co2footprint column is still jacked up
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
wheewww i figured this part out.
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i have got another small problem before i will be completed with this. everything works fine, but it outputs out of line.





is there a simple way to do this? im aware of print f, but ive never used it with this type of output, will it work? how do you do it?
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1659
    
  11

Try this:



I think that'll do it.


When you do things right, people won't be sure you've done anything at all.
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
thank you so much man. sooooo glad to get this assignment done its like wooow
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1659
    
  11

So.... post what you have so we can see......

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
nathan gibson wrote: . . . man. . . .
Don't call Janeice "man"
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1659
    
  11

Campbell Ritchie wrote:
nathan gibson wrote: . . . man. . . .
Don't call Janeice "man"


It's nice *someone* looks out for me.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
Janeice DelVecchio wrote:It's nice *someone* looks out for me.
You're welcome I have to do the same for Jeanne and Joanne too, sometimes.
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
Why have you got so many fields? Why are they all public?

Why are you dividing aveElecBill by itself? And are you getting 1.0?
nathan gibson
Ranch Hand

Joined: Sep 16, 2009
Posts: 120
i think i grabbed the wrong revision and posted it. i had those as private. actually its (aveElecBill/aveElecPrice), i know that sounds the same, but it is just a poor naming of variables. its actually your bill/ how much you are charged for each "piece" (whatever the unit is, watts i guess) i cant vouch for the formula it was given to me with the assignment.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
nathan gibson wrote: . . . actually its (aveElecBill/aveElecPrice) . . .
I'm glad it was just me not reading it properly
 
Don't get me started about those stupid light bulbs.
 
subject: calculation methods
 
Similar Threads
array of objects confusion
using array list
Output Issues
Expected output is incorrect!
Desperately need help writing Tester