My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
package com.kirkk.bill;

import com.kirkk.cust.*;

import java.math.BigDecimal;

public class Bill {

private BigDecimal chargeAmount;
private Customer customer;

public Bill(Customer customer, BigDecimal chargeAmount) {
this.customer = customer;
this.chargeAmount = chargeAmount;
}
public BigDecimal getChargeAmount() {
return this.chargeAmount;
}

public BigDecimal pay() {
BigDecimal discount = new BigDecimal(1).subtract(this.customer.getDiscountAmount()).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal paidAmount = this.chargeAmount.multiply(discount).setScale(2);
//make the payment...
return paidAmount;
}

}

Change log

r75 by pragkirk on Nov 18, 2009   Diff
Initial Version
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 668 bytes, 27 lines

File properties

svn:executable
Powered by Google Project Hosting