Search:

Type: Posts; User: Harrald

Search: Search took 0.10 seconds.

  1. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Well now that the assignment is turned and finish, I can work on cleaning up the code and fixing some things you pointed out that wasn't related directly to the assignment. I am going to start the...
  2. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Here is the final code:



    public class PayrollClass
    {

    private String name;
    private int numberEmployees;
    private float avgSalary;
  3. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    FIXED IT!!!! WOOT!!!!
  4. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    I'm stumped...
  5. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Nevermind... That didn't work. It is still returning the initial values...
  6. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    HA!

    A simple of swapping the variables looks like it worked. instead of className = name; name = className;
  7. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    The initial values get returned...
  8. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Oh and nevermind. I get a value of 0.00USD for the total... I'm missing something in the variable dance...
  9. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    The P was supposed to be for PayrollClass, as in the variable of name that is in the PayrollClass, PName. Guess it only made sense to me lol.

    I thought the PName was set in the constructor? PName...
  10. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Completely revamped code.

    Here is the class:



    public class PayrollClass
    {

    private String name;
  11. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Modified the constructor yet again by removing the variable types in the parameters. That took care of that.

    However I have 3 new errors.

    error: Constructor PayrollClass in class PayrollClass...
  12. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Modified the constructor to include commas since there are multiple parameters...

    but now I get 6 errors. The three from before including three saying illegal start of expression.
  13. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Here is the other part, the class with the main method.



    // Thomas Harrald IT215
    // Checkpoint Payroll Program Three
    //Use a Class to Store and Retrieve Dept Name, Number of Employee, avg...
  14. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Fixed the Class that will be used in the main method.



    public class PayrollClass
    {
    private float totalDept;
    private String name;
    private int numberEmployees;
    private float avgSalary;
  15. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Ok, If I'm not mistaken this is a 2 part assignment. 2 separate files.

    Here is one of them, the class that will be used to create an object.



    public class PayrollClass
    {
    private float...
  16. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    Yep thanks for the tips.

    I actually think the assignment is a lot easier than I was making it.

    I am working on it currently.
  17. Replies
    27
    Views
    2,698

    [SOLVED] Re: Basic help with Constructors and Classes

    It's horribly wrong. I'm in the process of trying to figure it out. I think I'm nuking it...

    I can't tell you specifically what's wrong because I don't really know what is wrong with it lol, if...
  18. Replies
    27
    Views
    2,698

    [SOLVED] Basic help with Constructors and Classes

    I have been racking my brain trying to understand this fundamental concept and It is tearing me apart. Here is what I am supposed to do for my assignment:

    Modify the Payroll Program so that it...
Results 1 to 18 of 18