Write the function that calculates price of the cup of coffee where price of the condiments depends on size of the coffee cup. For example milk cost 10 c for small cup 15 c for medium and 20 c for large
You have to index elements of one array of enums by essentially using ordinals of another enum
Use Decorator pattern
classic decorator design pattern, 23 design patterns book has this.
Jan 13, 2011