Coding help

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Shaitann

Thread Starter
Joined
Dec 1, 2016
Messages
4
So, i have this project and i have done minimal work on it just because of the errors, i have done this so far, bot not even this works. I get "The entity already exists" (the hw worksheet is below)


public class Employee
{
private double myhours;
private String myname;
private double myhourlyrate;


public Employee()
{
myname = "name";
myhours = 0.0;
myhourlyrate = 0.0;
}


public Employee(String name, double hours, double hourlyrate)
{
name = myname;
hours = myhours;
hourlyrate = myhourlyrate;
}


public String getName()
{
return myname;
}



public double getHours()
{
return myhours;
}




public double getHourlyrate()
{
return myhourlyrate;
}


public void setHours(double hours)
{
hours = myhours;
}


public void setName(String name)
{
name = myname;
}


public void setHourlyrate(double hourlyrate)
{
hourlyrate = myhourlyrate;
}

public static void main(String[] args)
{
Employee my1 = new Employee();
System.out.println(my1.getName());
}
}
 

Attachments

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
117,162
Sorry but it's our policy not to assist with homework as it's best that you find the answers yourself.

Therefore, I'm closing this thread.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top