Skip to content

Instantly share code, notes, and snippets.

@chrisza4
Created December 31, 2016 10:23
Show Gist options
  • Select an option

  • Save chrisza4/68ccbe96f33dc4a1bcf50038a3bee9ff to your computer and use it in GitHub Desktop.

Select an option

Save chrisza4/68ccbe96f33dc4a1bcf50038a3bee9ff to your computer and use it in GitHub Desktop.
public class Invoice {
private bool isForXDepartment;
public Invoice(bool isForXDepartment) {
// บริษัทนี้ถ้าเป็นใบเสร็จของแผนก X จะต้องคำนวณภาษีและส่วนลดแบบพิเศษ
this.isForXDepartment = isForXDepartment;
}
public double calculateSumPrice () {
if (this.isForXDepartment) {
return this.calculateSumPriceForDepartmentX();
}
else {
return this.calculateSumPrice();
}
}
private double calculateSumPriceForDepartmentX () {
}
private double calculateSumPrice() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment