Question
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
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started