Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fix these codes so they are able to debug and compile in Linux Circle.h code below #ifndef CIRCLE _ H #define CIRCLE _ H #include
Fix these codes so they are able to debug and compile in Linux
Circle.h code below
#ifndef CIRCLEH
#define CIRCLEH
#include
using namespace std;
class Circle
private:
double radius;radius of the circle
double area;area of the circle
double circumference;circumferencee of the circle
double pi; the value of pi
public:
Circleradius;areanew double;area;circumference new double;
void setraddouble radradius rad;;
double computearea
area pipowradius;return area;;
double computecircumference
circumferencepiradius;return circumference;
double checkraddouble rad
ifrad && rad!return true;elsereturn false;;
~Circle;
;
#endif
circle.cpp code below
#include
#include "circle.h
using namespace std;
int main
double usersradius; value to store users given radius value;
Circle firstcircle; define a pointer to a circle
firstcircle new Circle; allocate memory for the object and call the constructor
cout"This Program computes various metrics of a circle"usersradus;
firstcirclesetradusersradius;
cout"Area of circle is:
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