When Elvis gets up in the morning, he likes to have a little fun with his donuts. He loves crme filled, strawberry filled, grape filled, apple filled, cinnamon filled, blueberry filled and banana filled donuts.
By the time Elvis sits down to breakfast, the Lazy Susan is loaded up with five donuts chosen at random by his housekeeper. Elvis spins the Lazy Susan three times, eats whats closest to him, and goes about his business for the day.
Design Requirements:
- Three classes Elvis, LazySusan and Donut. Each class has a defined toString() method.
- A Donut has a Filling. Filling should be an enumerated type. Tools you may need:The length of an enum : Filling.values().length.Conversion of an int to a enum value : Filling.values()[3].
- Donuts should be held in arrays inside Elvis and LazySusan.
- When Elvis eats a donut it must, of course, come off the LazySusan.
- Your driver should load up the Lazy Susan, display its contents, spin it three times, display Elvis tummy, and whats left on the Lazy Susan.
Reviews
There are no reviews yet.