Results 1 to 4 of 4
  1. #1
    Britt7 is offline Member
    Join Date
    Oct 2008
    Posts
    1
    Rep Power
    0

    Default Implement a class Employee-Help due tmrw!

    I have absolutely no idea how to do this..

    Implement a class Employee.

    public Employee(String employeeName, double currentSalary)

    and methods

    public String getName()
    public double getSalary()
    public void raiseSalary(double by Percent)

    Also supply an EmployeeTester class that tests all methods

    I tried to start but have no idea and got all compiler messages..
    public class Employee
    {
    String name;
    double currentSalary;

    public Employee(String name, double currentSalary);
    {

    public String getName()
    {
    return name;
    }
    public double getSalary()
    {
    return salary;
    }
    }


    }

    Can anyone help?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    First the bitter truth: Our track record is not too good at helping those who "have absolutely no idea how to do this". Usually folks in this situation are much better off going to their instructor or a tutor to arrange intense one-on-one face to face tutoring. The problem is that we while we can answer straight-forward questions, we can't put concepts into your head if the rudiments aren't there to begin with.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    So, now on to your problem:
    1) Do you know how to make the most basic of classes? Can you create a class that has a few variables, methods, and a constructor? If so, why not try to create an Employee class right now, and then post what you have. You can't break your computer by trying.

    Oh, and when you post your code, please use code tags so that your code retains its formatting and remains "readable". To do this, you will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. Another way is to place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:

    Java Code:
    [code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    [/code]

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    public Employee(String name, double currentSalary);

    This does not need a trailing semicolon.

    If its due tomorrow, you should have started a week ago.

    Do your own homework.

    Using a double for money is a sin

Similar Threads

  1. Jsp Project on Employee Details
    By 82rathi.angara in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 01-20-2014, 09:34 AM
  2. Employee Database using an Array
    By hajeer in forum AWT / Swing
    Replies: 2
    Last Post: 07-30-2008, 04:05 AM
  3. Help to implement JTable
    By adeeb in forum AWT / Swing
    Replies: 0
    Last Post: 06-04-2008, 06:26 PM
  4. How to implement HttpSessionListener in JSP
    By Srikanth816 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-16-2008, 09:22 AM
  5. How can we implement IPC in java
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06:38 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
  •