Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. package uml2;
  3.  
  4. public class Customer {
  5. private int id;
  6. private String name;
  7. double bill;
  8.  
  9. public int getId() {
  10. return id;
  11. }
  12.  
  13. public void setId(int id) {
  14. this.id = id;
  15. }
  16.  
  17. public String getName() {
  18. return name;
  19. }
  20.  
  21. public void setName(String name) {
  22. this.name = name;
  23. }
  24. Customer()
  25. {
  26.  
  27. }
  28. Customer(int i,String n,double b)
  29. {
  30. id=i;
  31. name=n;
  32. bill=b;
  33. }
  34. public double getDiscount()
  35. {
  36. double d,f;
  37. if(bill>10000){
  38.  
  39.  
  40. d=(bill*10)/100.0;
  41. f=bill-d;
  42. return f;
  43. }
  44. else
  45. {
  46. return bill;
  47. }
  48.  
  49. }
  50. public void display()
  51. {
  52. System.out.println("Id= "+id+"\nName= "+name+"\nBill= "+getDiscount());
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement