Question: Composite Design Pattern) 100 points Problem Description: You are asked to design a software to structure pictures drawings based on the composite pattern and

Composite Design Pattern) 100 points Problem Description: You are asked to design

Composite Design Pattern) 100 points Problem Description: You are asked to design a software to structure pictures drawings based on the composite pattern and the following software requirements: Each picture can contain any number of other pictures, circles, and rectangles. Each picture, circle, or rectangle needs to have method to draw itself. You need to test your code by writing a main method to do the followings: 1. Create a picture (call it pic1) that contains two circles call them circle1 and circle2. Then put pic1 inside another picture (call it pic2), which also contains a rectangle (call it rectangle1). 2. Invoke method draw on pic2: Your code should produce an output like the following: {Draw pic2 {Draw rectanglel} {Draw Pic1 {Draw circlel} {Draw circle2} } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!