How to improve this BankAccount class
I have the following class i which it is predetermined that there will be just 2 types of accounts i.e. Single and Joint. Now i want to use enum here. How can i do that and would it be useful and why?
Also i have a variable 'DateOfOpening' whose data type is string. Here i want to use my own data type called 'Date'. How can i do that? Wonder if i should use time.h header file here for this pusrpose. Please comment, explain and justify your answer
class BankAccount
{
private:
string type;
string name;
string DateOfOpening;
string accno;
double balance;
public:
void setAccno(string);
string getAccno();
void setType(string);
string getType();
void setName(string);
string getName();
void setDateOfOpening(string);
string getDateOfOpening();
void Deposit(double);
void Withdraw(double);
double DisplayBalance(void);
};
__________________
MAXOOD!
Life is an endless journey towards perfection
|