Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; class Circle { public: double pi; double radius; public: Circle(){ pi = 3.14159; radius = 1.0; } void setRadius(double r){

#include  #include  using namespace std; class Circle { public: double pi; double radius; public: Circle(){ pi = 3.14159; radius = 1.0; } void setRadius(double r){ radius = r; } double getRadius(){ return radius; } double getArea(){ return pi*radius*radius; } }; int main() { int r; cout<<"Enter radius: "; cin>>r; Circle c; c.setRadius(r); cout<<"Area = "< 

In C++ add a default constructor to the Circle class in source code above. The constructor should initialize the radius member to 0

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

3-2 Explain the concept of ethical behavior 3436

Answered: 1 week ago

Question

=+9. Think about a campaign direction.

Answered: 1 week ago

Question

=+Who is the audience?

Answered: 1 week ago