Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Using the base class Shape shown below, implement the following functions for the two classes named Square and Circle. Save your program in a

image text in transcribed
2. Using the base class Shape shown below, implement the following functions for the two classes named Square and Circle. Save your program in a file called Q2.cpp and upload it to Question \#2 Square::Square(int s, string n ) : Shape(n) double Square::calcarea() Circle::Circle(int r, string nm ) : Shape(nm) double Circle::calcarea() Hinclude ciostreas. using nanespacel std? const double pi - 3.14 : class shape f privace: atring name: publite: Shape() ( name - "shape" t I Shape(string n) ( name: =n | ntring gethame () if return (nane) ; 1 virtual double calcareai) ir return of i 1; clant square i publlo shape 1 private: int sided public: squerelint sid, string nin); // paraneter sd is the side; paraneter nm is the nahe of the shape doable calcarea () : // returns the value of side * side Glasz Cirolet public shape T. Privatef int radtyer public: double calearea (i) 1; feterts she value of pirradiustradlus

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

Define Administration?

Answered: 1 week ago