Hi!
I have litle problem whit this question: I try to write a program a bout
Salary. The user writes(from keyboard) the workers name, hourePayment and hour(how many hours He has worked). The program must compute for first week ,second week....fourth week
May be the user want to know just about one week(second week)or...,
The user writes just one times name and hourPayment, but he must write hour(total hours he has worked) for every week(may be ha has worked 30 hours first week and 40 hours second week.....).I wrote the program but I have problem whit how do I use the same information (computation )for every week. I need a switch or not but also I don not know How do I use the tostring method here.
PETER
class Salary{
private String name;
private double hourPayment;
....................
public Salary (String name, double hourPayment, .........................){
this.name= name;
this.hourPayment=hourPayment;
........................................
public String getNamn(){
return name;}
public double getHourPayment(){
return hourPayment;
}
public double compute(int time){
if(time<=40){
normal Salary =(hourPayment*time);}
else if(time>40){

....=(((40*hourPayment)+(time-40)*(3/2)*hourPayment));
else if(timmar>70){
System.out.println("WARRNING:"+" "+"You have worked more than 30
....................................................................... }


public String toString(){
return (namn, hourPayment,lastweeksOverTime, totaltOvertim);