Well, I keep coming out with a negative number after the deductions
James Boswell wrote:
Well, I keep coming out with a negative number after the deductions
Are you working out my paycheck Tyler? :-)
Stephan van Hulst wrote:Well, show us exactly how you are calculating the final result, and what input values you're using.
Campbell Ritchie wrote:I think you are trying to do too much at once. Get one bit working, then try to get the rest working. Don’lt attempt too much at once.
Also follow James Boswell’s advice: never never use doubles for money. Using floats is evern worse; both are unsuitable because of the restricted precision. I wrote an example of the use of BigDecimal here, with some problems demonstrated.
You ought to avoid coding things like 0.035. You are better off creating constants to store those values inYes, you ought to write documentation comments even for private fields where you know they won’t be displayed anywhere (or at least, I think you ought to). Yes, you need the quote marks around 0.15; you want to use a String argument, not a double.
Once you have got that all working, I suggest you enhance the system to read the tax rates from a text file.
Campbell Ritchie wrote:Also follow James Boswell’s advice: never never use doubles for money.
What’s wrong with that?Wendy Gibbons wrote:. . . ID_SERIAL_135 = 135
Campbell Ritchie wrote:
What’s wrong with that?Wendy Gibbons wrote:. . . ID_SERIAL_135 = 135
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Campbell Ritchie wrote:
What’s wrong with that?Wendy Gibbons wrote:. . . ID_SERIAL_135 = 135
Wendy Gibbons wrote:
OCPJP
In preparing for battle I have always found that plans are useless, but planning is indispensable. -- Dwight D. Eisenhower
Oh, that’s even better! You have some brilliant people there who ought to supply material to Roedy Green.Wendy Gibbons wrote: . . . the actual code went . . .
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|