Hi, I'm new to C++ but have to construct a program to solve basic engineering problems.
I have several errors in my code and have no idea how to solve them - any ideas?
Thanks
Code:
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
class Second_Moment_Area
{
private:
float secondMomentOfArea;
float base;
float depth;
public:
Second_Moment_Area( float paraSecondMomentOfArea, float paraBase, float paraDepth) // normal constructor
{
secondMomentOfArea = paraSecondMomentOfArea; base = paraBase; depth = paraDepth;
}
Second_Moment_Area() { secondMomentOfArea = base = depth = 0.0;}
Second_Moment_Area(float secondMomentOfArea, float base, float depth)
{
void setSecondMomentOfArea (float paraSecondMomentOfArea);
{
this->secondMomentOfArea = secondMomentOfArea;
}
void setBase (float paraBase);
{
this->base = base;
}
void setDepth (float paraDepth);
{
this->depth = depth;
}
void calculateI ();
{
this->secondMomentOfArea = ((this->base * this->depth * this->depth * this->depth) / 12);
}
{
void print ()
Second_Moment_Area(float paraSecondMomentOfArea)
~Second_Moment_Area
cout<< "This result is "<< secondMomentOfArea << endl;
}
};
int main()
{
Second_Moment_Area secondMomentOfArea;
secondMomentOfArea.setSecondMomentOfArea();
Second_Moment_Area.calculateI();
Second_Moment_Area.print();
return 0;
}
};