All pastes #1593732 Raw Edit

Employee

public java v1 · immutable
#1593732 ·published 2009-10-05 04:14 UTC
rendered paste body
/** * A class which calculates the salary for an employee. */public class Employee{    /**     * Construct an employee with a name and a salary.     * @param employeeName The name of the employee.     * @param currentSalary The current salary of the employee.     */    public Employee(String employeeName, double currentSalary)    {        name = employeeName;        salary = currentSalary;    }    /**     * Return the name of the employee.     */    public String getName()    {        return name;    }    /**     * Return the salary of the employee.     */    public double getSalary()    {        return salary;    }    /**     * Raise the salary of the employee by the specified amount.     * @param byPercent The amount to raise the salary in a percentage.     */    public void raiseSalary(double byPercent)    {                salary = (byPercent/100)*salary + salary;    }        private String name;    private double salary;}