Results 1 to 5 of 5
- 12-07-2010, 05:19 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 15
- Rep Power
- 0
- 12-07-2010, 05:44 PM #2
Member
- Join Date
- Dec 2010
- Posts
- 45
- Rep Power
- 0
Have you tried tracing your code? If you do this you will probably be able to answer a lot of your questions.Some of the problems I'm encountering:
First of all, am I using the right kind of loop? Would a do-while loop or a for loop be better for this problem?
Secondly, if I enter an amount less than $20, the loop just keeps running and won't exit. Why is this?
Last, if I enter an amount more than $20, the only output I get is Employee Name.
Any hints or advice would be greatly appreciated!
- 12-07-2010, 05:54 PM #3
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
I don't know what your requirements are, and I'm having trouble gleaning them from your code. Whatever they are, it's hard to imagine that cramming everything into a big gray main() method is the best approach. What have you covered in your course so far? Classes? Constructors? Getters and setters? Methods?
There seems to be an assumption in two places in your code that there are exactly four weeks in a month. Is this code to calculate payroll on some other planet where that assumption holds true?
-Gary-
- 12-07-2010, 06:21 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 12-08-2010, 07:06 AM #5
Similar Threads
-
assignment
By mr.othman in forum New To JavaReplies: 4Last Post: 12-03-2010, 02:55 PM -
Assignment
By shinkymar in forum New To JavaReplies: 2Last Post: 03-06-2010, 01:17 PM -
Hello all I joined this forum today
By psm in forum Advanced JavaReplies: 4Last Post: 04-16-2009, 01:26 PM -
Inventory Program Part 3 - DUE TODAY (7/28/08)
By ljk8950 in forum New To JavaReplies: 7Last Post: 07-27-2008, 10:28 PM -
hi today i have joined in the forum
By nagesh_113 in forum IntroductionsReplies: 1Last Post: 07-29-2007, 07:03 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks