Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Ruby: A geometric modeling program defines an abstract base class called Shape that models a generic shape. Sub-classes of this class are concrete implementations

Using Ruby:

A geometric modeling program defines an abstract base class called Shape that models a generic shape. Sub-classes of this class are concrete implementations of specific shapes. For example, you would have a Square class, Circle class, and so on. Shapes use formatter classes to render shapes on output devices. The system in Table 2 currently has two of these classes:

Table 2:

image text in transcribed

Draw a UML diagram that documents the current design. Modify this design so that one can add new shapes and new output formats independently 2 of each other. Document your new design. Implement a prototype that demonstrates how you can add a Polygon and XMLForamatter classes to your design. Add print statements that state what each command would do on an actual device.

class Screen def drawLine(x1,y1,x2,y2) end def drawPixel(x,y, color) end def drawCircle(x, y,radius) end class Printer def drawLine(x1,y1,x2,y2) end def drawPixel(x,y, color) end def drawCircle(x, y,radius) end end class Screen def drawLine(x1,y1,x2,y2) end def drawPixel(x,y, color) end def drawCircle(x, y,radius) end class Printer def drawLine(x1,y1,x2,y2) end def drawPixel(x,y, color) end def drawCircle(x, y,radius) end end

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago