Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ code. write the code for the beginner Each file contains points which form either a square, triangle, and rectangle. Create a derived class for

c++ code. write the code for the beginner

Each file contains points which form either a square, triangle, and rectangle. Create a derived class for each shape which uses the "Shape" class as a base. Add a virtual "area" and "perimeter" function to the base the class and implementation for each of these in the derived square, triangle, and rectangle classes. Feel free to add any additional data member objects for these shapes as you find helpful (such as a side length for squares, length and width for rectangles.) Create an overloaded constructor which uses 3 points as input for the triangle class, and 4 points for the square and rectangle.

file1:

0,0

2,0

0,2

2,2

file2:

0,0

2,0

1,1

file3:

0,0

2,0

0,4

2,4

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

More Books

Students also viewed these Databases questions

Question

Describe the process of software development life cycle ( SDLC ) .

Answered: 1 week ago

Question

6. Explain the power of labels.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago