I wanted to write a simple program that uses classes but I've been running into errors. Anyone have a clue as to what is wrong with my code because I can't seem to figure it out.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
class cone{
private:
double radius;
double height;
public:
cone();
void setvolume();//
double conevol();
};
//implementation
void cone(){
double radius;
double height;
}
void setvolume(double r,double h){
double radius=r;
double height=h;
}
double conevol(double r,double h){
double vol=(1/3.0)*(3.14159265)*r*r*h;
return vol;
}
int main(){
cone A;
cout<<"The current volume of the cone is: "<<A.convol<<endl;
A.setvolume(3.4,5.63);
cout<<"The volume of the cone is now"<<A.conevol()<<endl;
system("PAUSE");
return 0;
}