-
Notifications
You must be signed in to change notification settings - Fork 0
/
customers.java
31 lines (29 loc) · 900 Bytes
/
customers.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication3;
import java.util.*;
/**
*
* @author lenovo
*/
public class customer extends person {
double Balance, Order_price;
ArrayList<order> list= new ArrayList<>();
private int array_size;
public customer(int id, int age, String phone,String add, String name, double balance, double price,order d){
super(id, age, phone,add, name);
this.Balance= balance;
this.Order_price=discount_rate();
this.array_size=list.size();
for(int i=0;i<list.size();i++)
list.add(i,d);
}
public double discount_rate()
{
double final_price= this.Order_price-(0.1*(this.Order_price+this.array_size));
return final_price;
}
}