Skip to content

Commit 2c0e4f4

Browse files
The prices will now be handled by instances of the class BigDecimal.
1 parent f0e3671 commit 2c0e4f4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/coreapi/Order.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
package coreapi;
66

7+
import java.math.BigDecimal;
78
import java.util.Date;
89
import java.util.List;
910
import java.util.Map;
@@ -14,8 +15,9 @@ public interface Order {
1415
* Returns the combined cost of the whole order.
1516
* Takes into account which products comprised the order, and how many of each of them.
1617
* @return the cost of the order.
18+
* @see BigDecimal
1719
*/
18-
public float totalCost();
20+
public BigDecimal totalCost();
1921
/**
2022
* Returns the unique Id assigned to this order.
2123
* Each Order has a unique identifier within the system. Two different orders cannot

src/main/java/coreapi/Product.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package coreapi;
22

3+
import java.math.BigDecimal;
4+
35
public interface Product {
46

57
public int getId();
6-
public float getPrice();
8+
public BigDecimal getPrice();
79
public String getName();
810

911
}

0 commit comments

Comments
 (0)