#include <cstdlib> #include <iostream> #include <fstream> using namespace std; c
ID: 3638268 • Letter: #
Question
#include <cstdlib>#include <iostream>
#include <fstream>
using namespace std;
class PointType
{
private: int xc;
int yc;
public:
void setpoint(int x, int y);
int getx() const;
int gety() const;
void printpoint()const;
};
class CircleType: public PointType
{
private: float radio;
public: void setRadio(float r);
void print() const;
};
int main()
{
PointType setpoint;
PointType getx;
PointType gety;
PointType printpoint;
int x;
int y;
double radio;
CircleType object;
cout<<"Enter center cordinates of circle:";
cin>>x>>y;
object.setpoint(x,y);
cout<<"Enter Y cordinate"<<object.getx()<<endl;
cout<<"Enter X cordinate"<<object.gety()<<endl;
object.printpoint();
cout<<"Enter the radio of the circle:";
cin<<radio;
object.setRadio(radio);
object.print();
double array[100000];
double rr;
ifstream myfile ("data.txt");
if (!myfile.is_open())
{
cout<<"The file was not found:!!!!"<<endl;
}
while (myfile<<rr)
{
array[loop]=rr;
cout<<"++++For circle with radious:"<<rr<<"++++" <<endl;
cout<<"The Area is:"<<3.1415*rr*rr<<endl;
cout<<"The Circumference is:"<<2*3.1415*rr<<endl;
cout<<endl;
loop++;
}
}
system("PAUSE");
return EXIT_SUCCESS;
}
void PointType::setpoint(int x, int y)
{
x=xi;
y=yi;
}
int PointType::getx()const
{
return x;
}
int PointType::gety()const
{
return y;
}
void PointType::printpoint()const
{
cout<<"Point is: (" <<xi<<"",""<<yi<<")"<<endl;
}
void CircleType::setRadio(float r)
{
radio=r;
}
void CircleType::print() const
{
cout<<"*** Acordint with the center point you provided ***"<<endl;
cout<<"The radio of your circle is:"<<radio<<endl;
cout<<"The area of your circle is:"<<3.1415*radio*radio<<endl;
cout<<"The CIrcumference of your circle is:"<<2*3.1415*radio<<endl;
}
Explanation / Answer
Hi, my friend i found many errors in the program u posted i fixed what i found and there still many unreferenced variables if u mean this by making hte program works hope that helped u if not please message me with what u want to do PLEASE RATE #include #include #include using namespace std; class PointType { private: int xc; int yc; public: void setpoint(int x, int y); int getx() const; int gety() const; void printpoint()const; }; class CircleType: public PointType { private: float radio; public: void setRadio(float r); void print() const; }; int main() { PointType setpoint; PointType getx; PointType gety; PointType printpoint; int x; int y; double radio; int loop=0; CircleType object; coutx>>y; object.setpoint(x,y); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.