Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please answer in C++ code only if you know Lab 03 - Shape Interface Write the code and upload it to your GitHub account in

please answer in C++ code only if you know
image text in transcribed
Lab 03 - Shape Interface Write the code and upload it to your GitHub account in a directory named "Lab03". For this lab, your objective is to create the header file "Shape.h". In the header file define the interface Shape that has A double constant method named Perimeter() that takes no parameters. A double constant method named Area() that takes no parameters, And the class Square that publicly inherits Shape and has components Private double field named side. Public default constructor. It assigns 1 to side. Public overloaded constructor that takes one double parameter. It assigns the parameter to side if the parameter is positive; otherwise, it assigns 1 to side. Public copy constructor Public assignment operator. Public empty destructor. Public constant get method for side. O Public set method for side. It assigns the parameter to side only if the parameter is positive; otherwise, it does nothing Public overridden Perimeter() method. It returns the perimeter of the square, O Public overridden Area() method. It returns the area of the square. O Public string constant method named ToString() that takes no parameters. It returns a string of side enclosed in parentheses. Overloaded ostream operator. It outputs the same as ToString()

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions