Kiero ayuda con este codigo
es decir kisiera qe me ayuden a COMENTAR cada linea de este codigo para qe sirve
o sea comentar CADA LINEA para qe sirve...
si me ayudan en eso seria estupendo...tengo 8 clases:D luego poco a poco subire las otras :P
1ra clase
public class CommissionEmployee {
private String firstName;
private String lastName;
private String socialSecurityNumber;
private double grossSales;
private double commissionRate;
public CommissionEmployee (String first, String last, String ssn, double sales, double rate){
firstName = first;
lastName = last;
socialSecurityNumber = ssn;
setGrossSales (sales);
setCommissionRate (rate);
}
public void setFirstName (String first){
firstName = first;
}
public String getFirstName(){
return firstName;
}
public void setLastName (String last){
lastName = last;
}
public String getLastName(){
return lastName;
}
public void setSocialSecurityNumber (String ssn){
socialSecurityNumber = ssn;
}
public String getSocialSecurityNumber(){
return socialSecurityNumber;
}
public void setGrossSales (double sales){
if (sales >= 0.0)
grossSales = sales;
else
throw new IllegalArgumentException("Gross sales must be >= 0.0");
}
public double getGrossSales(){
return grossSales;
}
public void setCommissionRate (double rate){
if (rate > 0.0 && rate < 1.0)
commissionRate = rate;
else
throw new IllegalArgumentException("Commission rate must be > 0.0 and < 1.0");
}
public double getCommissionRate(){
return commissionRate;
}
public double earnings(){
return getCommissionRate() * getGrossSales();
}
@Override
public String toString(){
return String.format("%s: %s %s\n%s: %s\n%s: %.2f\n%s: %.2f",
"commission employee", getFirstName(), getLastName(),
"social security number", getSocialSecurityNumber(),
"gross sales", getGrossSales(),
"commission rate", getCommissionRate());
}
}