Advertisement
advictoriam

Untitled

Feb 1st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. /**
  2.    A salary to which a bonus can be applied.
  3. */
  4. public class Salary
  5. {
  6.    private double salary;
  7.    public Salary(int aSalary)
  8.    {
  9.       salary = (double)aSalary;
  10.    }
  11.    public void applyBonus(double bonus)
  12.    {
  13.       salary *= 1 + bonus;
  14.    }
  15.    public double getValue(){return salary;}
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement