Answered step by step
Verified Expert Solution
Link Copied!

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 CIRCLE_H
#define CIRCLE_H
#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=3.1415;// the value of pi
public:
Circle(){radius=0;area=new double;area=0;circumference= new double;}
void set_rad(double rad){radius = rad;};
double compute_area()
{*area =(pi*pow(radius,2.0));return *area;};
double compute_circumference()
{*(circumference+1)=2*pi*radius;return *circumference;}
double check_rad(double rad)
{if(rad>0 && rad!=0){return true;}else{return false;}};
~Circle();
};
#endif
circle.cpp code below
#include
#include "circle.h"
using namespace std;
int main()
{
double users_radius;// value to store users given radius value;
Circle * first_circle;// define a pointer to a circle
first_circle = new Circle();// allocate memory for the object and call the constructor
cout<<"This Program computes various metrics of a circle">users_radus;
first_circle->set_rad(users_radius);
cout<<"Area of circle is:"

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions