Advertisement
JoshJurban

Exercise 3.8 Construct/Methods

Oct 8th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package employee;
  2.  
  3. public class EmployeeManager
  4. {
  5.  
  6.         private String name;
  7.         private double salary;
  8.        
  9.         /**
  10.          *Constructs an employee
  11.          *@param getName the name of the employee
  12.          */
  13.         public EmployeeManager(String employeeName, double currentSalary)
  14.         {
  15.             name = employeeName;
  16.             salary = currentSalary;
  17.         }
  18.    
  19.         public String getName()
  20.         {
  21.             return name;
  22.         }
  23.        
  24.         public double getSalary()
  25.         {
  26.             return salary;
  27.         }
  28.        
  29.         public void raiseSalary(double byPercent)
  30.         {
  31.             salary = salary * (1 + byPercent);
  32.         }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement