Results 1 to 5 of 5
  1. #1
    KAM0002 is offline Member
    Join Date
    Dec 2010
    Posts
    15
    Rep Power
    0

    Default Need help with assignment (due today)

    See post below with updated info
    Last edited by KAM0002; 12-07-2010 at 06:14 PM.

  2. #2
    Bertstar is offline Member
    Join Date
    Dec 2010
    Posts
    45
    Rep Power
    0

    Default

    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!
    Have you tried tracing your code? If you do this you will probably be able to answer a lot of your questions.

  3. #3
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    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-

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,651
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by KAM0002 View Post
    Payoff.java:84: illegal start of type
    System.exit(0);
    ^
    Payoff.java:87: class, interface, or enum expected
    } // End of Payoff class.
    ^
    3 errors
    Count your curly brackets; they don't match and please properly align them and indent your code properly because as it is it's quite a mess.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default

    Quote Originally Posted by KAM0002 View Post
    See post below with updated info
    That's just rude, deleting three of your questions. I doubt anyone will try to help you in future.

    db

Similar Threads

  1. assignment
    By mr.othman in forum New To Java
    Replies: 4
    Last Post: 12-03-2010, 02:55 PM
  2. Assignment
    By shinkymar in forum New To Java
    Replies: 2
    Last Post: 03-06-2010, 01:17 PM
  3. Hello all I joined this forum today
    By psm in forum Advanced Java
    Replies: 4
    Last Post: 04-16-2009, 01:26 PM
  4. Inventory Program Part 3 - DUE TODAY (7/28/08)
    By ljk8950 in forum New To Java
    Replies: 7
    Last Post: 07-27-2008, 10:28 PM
  5. hi today i have joined in the forum
    By nagesh_113 in forum Introductions
    Replies: 1
    Last Post: 07-29-2007, 07:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •