Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class called Shapes that includes overloaded functions for the following shapes: c++ Square Triangle Circle For each Shape, include the following functions: area

Write a class called Shapes that includes overloaded functions for the following shapes: c++

  • Square
  • Triangle
  • Circle

For each Shape, include the following functions:

  • area
  • circumference
  • vertices
  • print
  • update

For each function, determine what parameters of what types it needs to accept and what it needs to return.

Hint: area and circumference parameters and return value should NOT be int.

Of course, also determine what attributes you need to define in the class.

For each Shape, include the following operators:

  • +
  • *
  • =

Each of these operators should take in the same class type(s) and return (also) the same type as indicated by the operator.

For example, for + with a triangle, add each of the attributes in order to return the new triangle.

Make sure that each of these classes has the canonical constructors and assignment operators (ie, copy and move).

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_2

Step: 3

blur-text-image_3

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions