-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProductBilling.java
More file actions
18 lines (18 loc) · 690 Bytes
/
Copy pathProductBilling.java
File metadata and controls
18 lines (18 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class ProductBilling {
public double calculateBill(double price1) {
System.out.println("Billing for 1 product...");
return price1;
}
public double calculateBill(double price1, double price2) {
System.out.println("Billing for 2 products...");
return price1 + price2;
}
public double calculateBill(double price1, double price2, double price3) {
System.out.println("Billing for 3 products...");
return price1 + price2 + price3;
}
public double applyDiscount(double totalBill, double discountPercent) {
double discount = (totalBill * discountPercent) / 100;
return totalBill - discount;
}
}