[JAVA] beginner Java questions, manipulating variables etc

Joined
Aug 6, 2006
Messages
44
Reaction score
0
hi rz members,

recently i started a java class, all we learn is some basic stuff, today, our instructor assigned us an project called Paycheck, where each one of us need to write codes to let the computer compute your salaries.the questions i am going to ask might seens a joke to you guys, so please bare with me here, thanks.

my instructor wanted us to write the thing in 3 parts:
Employee

Computer (ithink this is the part where i need come up with an equation to calculate each person's salary)

and a driver and runs the whole thing

here is what i have done so far:

Employee:
public class Employee
{
private String Name;
private double Wage;
private double Hours;

public Employee(String n, double w, double h)
{
Name = n;
Wage = w;
Hours = h;
}

public String getName()
{
return Name;
}

public double getWage()
{
return Wage;
}

public double getHours()
{
return Hours;
}

public String toString()
{
return Name + "worked" + Hours + "Hours" + "and earned " + Wage + "Dollars";
}
}

Computer: kinda stuck here.
public class Computer
{
final double Tax_rate = 0.7;

public Computer(double tr)
{
tr = Tax_rate;
}

public ComputeSalary(double s)
{


public double getSalary()
{
return s;
}
}

i cant even continue write the driver :(

thanks all the helps in advance.
 
Back