Da mihi sis bubulae frustum assae, solana tuberosa in modo Gallico fricta ac quassum lactatum coagulatum crassum.
Da mihi sis bubulae frustum assae, solana tuberosa in modo Gallico fricta ac quassum lactatum coagulatum crassum.
Aj Prieto wrote:As for the if-else statements, you could use "switch" statements, which would look nicer, in my opinion.
Aj Prieto wrote:You should probably look at the cases in your if-else statements. Specifically, what would happen if annualSales were 120,000.00.
Aj Prieto wrote:
Also, you shouldn't have to java on your own. You say that you're taking a class, why not ask the instructor or the other students for help? It might help you to understand things because you could get instant feedback.
Mike Simmons wrote:It's hard to read this and understand what's going on. I would break the main method into several smaller methods, with nice descriptive names on each so as to understand the goal of each piece of code.
Mike Simmons wrote:What's with the extra pair of braces on lines 64-65? Or the opening braces on lines 46 and 52, which are closed on lines 164 and 160 respectively. These don't do anything, other than cause confusion from people wondering what they do.
Daniel Flannigan wrote:I agree, but like what? I am an ultra beginner and this is the best I can do right now.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
No, you are nowhere near close, I am afraid. You still have the long methods and the long lines. The output at the bottom suggests you are calling println too often. The two if lines demonstrate a serious logic error when you bring them together.Daniel Flannigan wrote:Here is the code that is revised and I am close. . . .
}
if(annualSales >= 96000 && annualSales < 119999.99)
. . .
if(annualSales >= 120000.01)
. . .
Jim's Annual Sales Commission Potential
Total Sales Rate Commission Total Compensation
====================================================================
$126000.00 16.25% $20475.00 $50475.00
$131000.00 16.25% $21287.50 $51287.50
$136000.00 16.25% $22100.00 $52100.00
$141000.00 16.25% $22912.50 $52912.50
$146000.00 16.25% $23725.00 $53725.00
$151000.00 16.25% $24537.50 $54537.50
$156000.00 16.25% $25350.00 $55350.00
$161000.00 16.25% $26162.50 $56162.50
$166000.00 16.25% $26975.00 $56975.00
$171000.00 16.25% $27787.50 $57787.50
$176000.00 16.25% $28600.00 $58600.00
$181000.00 16.25% $29412.50 $59412.50
$186000.00 16.25% $30225.00 $60225.00
Daniel Flannigan wrote:The problem with being a beginner to Java is that some of the suggestions that I am getting don't make any sense to me.
My learning style is first see, then do.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
You will have to create those eyes yourself. Start by reformatting all that code. Indent it correctly as suggested here. Your } are farther to the right than your {. If you indent everything correctly, you will be able to see the structure of the program just by staring at the code. It becomes obvious, even without reading anything. Put one blank line before every method, too. And for the umpteenth time, break those long lines. I think I showed you how to do it, in your first post.Daniel Flannigan wrote: . . . I need a second set of eyes to please tell me where my calculations are going crazy . . .
Daniel Flannigan wrote:I spent a lot of time reworking the code the best of my understanding...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Consider Paul's rocket mass heater. |