Hi guys.
I have a question regarding C++. Its about good OOP design, i already know about Polymorphism,Encapsulation,Classes,Functions and etc.
However , i want to avoid spaghetti code. What tips or advice would you give me if i want to create clean and clutterless C++ code?
Would this be a good OOP code example ?
//File: Classes.h
class EXP_Variables
{
public:
int EXP;
};
class EXP_Gain : public EXP_Variables
{
public:
int CalcEXP (int LV,int Rate)
{
EXP = LV * Rate;
return (EXP);
};
};
class Print_EXP : public EXP_Gain
{
public:
int EXP_Print ()
{
cout << "Your Current Expierence is "<< EXP <<endl;
return 0;
}
}exprin;
// File: Main.cpp
int main ()
{
exprin.CalcEXP(7,88);
exprin.EXP_Print();
system("pause");
return 0;
};