Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. This question is about the Composite and Iterator patterns.(10 points) The diagram on the left shows the composite pattern for a wizard's bag. Assume

image text in transcribed
image text in transcribed
2. This question is about the Composite and Iterator patterns.(10 points) The diagram on the left shows the composite pattern for a wizard's bag. Assume that the Wizard has several wizard bags which he can put inside each other (like Babushka dolls). Bags can contain other bags or loose items. He can make the entire contents of a bag or a single item disappear by saying the words: Evanesco Ocsenave Magicltems Wizarditems WizardBayg a. Write java-like pseudo code to for a method called disappear() to make the WizardBag and everything in it disappear. (3 points) b. Write java-like pseudo code for an external iterator class that iterates through all of the Wizarditems (i.e the leaf items only). You will get points for showing the main methods of the class (3 points), showing any data structure(s) needed in the class (1 points), and writing high quality pseudocode inside the methods of the class (3 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

Summarize why phishing is a serious problem to commerce today.

Answered: 1 week ago