Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this, you are implement following shapes using structures and classes: Shape type Attributes Methods Relationship comments Point Integer type: x-coordinate, y-coordinate None Both (x,

In this, you are implement following shapes using structures and classes:

Shape type Attributes Methods Relationship comments
Point

Integer type:

x-coordinate, y-coordinate

None Both (x, y) coordinate attributes are publicly accessible
Shape

Point: reference point

Double: area, circumference

Char: line type (*, _, +, =, ...)

  • Getters and setters of attributes
  • computeArea()
  • computeCircumference()
  • moveBy (anInt)
  • draw (length)
  • draw (wd, ht)
  • setLineType(aChar)
Base class Abstract class
Rectangle

Integers: width, height

char: lineType

  • Implements the methods from Shape
  • Add setHeight(anInt), setBase(anInt)
Inherits from Shape
Square None
  • Inherits methods from Rectangle
  • Add setSide(anInt)
Inherits from Rectangle
Triangle Integers: base, height
  • Implements the methods from Shape
  • Add setHeight(anInt), setBase(anInt)
Inherits from Shape The shape of the triangle will be determined by the sizes of base and height
Circle Integer: radius
  • Implements the methods from Shape
  • Add setRadius(anInt)
Inherits from Shape
  • if radius> 2: draw(length) draws a circle with "(" radius spaces ")"
  • if radius < 3: draw an alphabet "O"

In your test driver program, the following should be demonstrated:

  • Draw similar to the following shapes of your own sizes.
 O * * * * * * * ********* ********* * * * * * * * * * * * * * * * * * * ********* (.........)(.........) ********************************** * * * * * * **********************************
  • Display the area and circumference of each shape of the picture above
  • Total area and circumference of all shapes in the picture

YOU WILL HAVE IN TOTAL OF 13 FILES(6 .CPP, 6 .H, AND MAIN DRIVER)!!!! PLEASE READ THE DIRECTIONS CAREFULLY!!! I DON'T UNDERSTAND AND KNOW WHERE TO START!!! ANSWER THE PROBLEM ASAP IN C++!!! WHOEVER ANSWERS THIS THANK YOU AND I WILL GIVE YOU AN UPVOTE!!

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

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

Describe three other types of visual aids.

Answered: 1 week ago