Let's create an algorithm for baristas in the DrinkMaker class. It will choose a suitable cup, add ingredients, and pour liquid. Also, we'll inherit DrinkMaker to create highly specialized algorithms for tea and latte.
Template pattern
- 8
Locked
Comments (7)
- Popular
- New
- Old
You must be signed in to leave a comment
Andrew Evans
8 March 2022, 14:43
Good task
0
Attila
1 April 2020, 14:58
10. The TeaMaker class's addIngredients method should display "Pour tea".
11. The TeaMaker class's pour method should display "Fill with boiling water".
"Pour tea" should be in the pour() method, and "Fill with boiling water" should be in the addIngredients() method.
0
Roman
13 April 2020, 12:31
No, you are wrong.
0
Attila
13 April 2020, 21:31
so the Tea is just an ingredient in the TeaMaker?
And when you pour from the TeaMaker, you just fill with boiling water?
Whatever.
0
Andrei
8 December 2020, 14:23
Lol, savage Roman.
+2
Payal Agarwal
6 September 2019, 13:10
I am not getting this, help me guys if you have done this
0
Andrew Evans
8 March 2022, 14:44
https://www.youtube.com/watch?v=aR1B8MlwbRI
Derek Banas has a good video on the Template Pattern
+1