Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package uml2;
- public class Customer {
- private int id;
- private String name;
- double bill;
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- Customer()
- {
- }
- Customer(int i,String n,double b)
- {
- id=i;
- name=n;
- bill=b;
- }
- public double getDiscount()
- {
- double d,f;
- if(bill>10000){
- d=(bill*10)/100.0;
- f=bill-d;
- return f;
- }
- else
- {
- return bill;
- }
- }
- public void display()
- {
- System.out.println("Id= "+id+"\nName= "+name+"\nBill= "+getDiscount());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement