Last active
May 14, 2016 17:10
-
-
Save HDBandit/6ee4f2db92c2535434af153e885275a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The client orders a Barbacoa pizza. The base price of the pizza is 15 dollars. | |
Pizza myOrder = Pizza.newPizza(15, baicon(), cheese(), tomato(), barbacoaSauce()); | |
// The client adds some complements | |
// We are decorating the pizza with complements | |
myOrder.setComplements( | |
Complements::chips, | |
Complements::extraDrink, | |
Complements::iceCream, | |
Complements::cinemaDisccount); | |
// Finally get the price | |
System.out.println("Base price of the barbacoa pizza: " + myOrder.getBasePrice()); | |
System.out.println("Total price to pay with the complements: " + myOrder.getTotalPrice()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment