Thanksgiving Dinner
Using the Decorator pattern, create a game that has the user add food to their plate without going over the weight or area limit of a paper plate. There are two different base types of plates: a small, sturdy 10-inch paper plate, or a large, flimsy, 12-inch plate. The plates can then be decorated with five different types of food: Turkey, Stuffing, Potatoes, Green Beans, and Pumpkin Pie. Each serving of the different foods has a weight, in ounces, and an area, in square inches. The user may load up their plate at the buffet as much as they like, but if the area or weight limit of the plate is surpassed, then their food falls to the floor.
Use the following UML and class descriptions to create your program:
SmallPlate
description(self): string
area(self): int
weight(self): int
count(self):int
LargePlate
description(self): string
area(self): int
weight(self): int
count(self): int
<interface>
Plate
<abstract> description(self): string
<abstract> area(self): int
<abstract> weight(self): int
<abstract> count(self): int
<abstract>
Plate Decorator
_plate: Plate
_init_(self, p)
description(self): string
area(self): int
weight(self): int
count(self): int
Turkey
description(self): string
area(self): int
weight(self): int
count(self): int
Stuffing
description(self): string
area(self): int
weight(self): int
count(self): int
Potatoes
description(self): string
area(self): int
weight(self): int
count(self): int
GreenBeans
description(self): string
area(self): int
weight(self): int
count(self): int
Pie
description(self): string
area(self): int
weight(self): int
count(self): int