Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer this using C++. Thanks! In this program assignment, you are requested to implement following shapes using structures and classes: Shape Attributes Methods Relationship

Please answer this using C++. Thanks!

image text in transcribed

image text in transcribed

In this program assignment, you are requested to implement following shapes using structures and classes: Shape Attributes Methods Relationship comments type Integer type: X- Point coordinate. None Both (x, y) coordinate attributes are publicly accessible y- coordinate Point: reference point Shape Double: area, circumference Getters and setters of attributes compute Area) computeCircumference) moveBy (anint) Base class draw (length) draw (wd, ht) .setLine Type(aChar) Abstract class Char: line type (-+, 5, ...) Integers: width, Rectangle height Implements the methods from Shape Inherits from Add setHeight(anlnt), Shape setBaseanlnt) char: line Type Square None Inherits methods from Rectangle Add setSide (anlnt) Inherits from Rectangle Triangle Integers: base, height Implements the methods from Shape Inherits from Add setHeight(anlnt), Shape setBase(anlnt) The shape of the triangle will be determined by the sizes of base and height if radius> 2: draw(length) draws a Circle Integer: radius Implements the methods Inherits from from Shape Shape Add setRadius(anlnt) circle with "" radius spaces ")" if radius 2: draw(length) draws a Circle Integer: radius Implements the methods Inherits from from Shape Shape Add setRadius(anlnt) circle with "" radius spaces ")" if radius

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions