Guest User

Untitled

a guest
Feb 18th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class Khalid {
  2.  
  3. private String name;
  4. private int age;
  5. private double salary;
  6. private double bonus;
  7.  
  8.  
  9.  
  10.  
  11.  
  12. public Khalid (String name, int age, double salary, double bonus) {
  13. this.name=name;
  14. this.age=age;
  15. this.salary=salary;
  16. this.bonus=bonus;
  17.  
  18.  
  19. }
  20.  
  21. public double setBonus (double age, double bonus){
  22.  
  23. this.bonus=age*bonus;
  24. }
  25.  
  26.  
  27.  
  28.  
  29. }
  30.  
  31.  
  32. Khalid kald =new Khalid("kald",18, 100,0);
  33. Khalid Lod=new Khalid("Lod", 28,500,0);
  34.  
  35. kald.setBonus(18, 1.1);
  36. System.println(kald.setBonus());
Add Comment
Please, Sign In to add comment