View Single Post
  #1 (permalink)  
Old February 25th, 2009, 07:41 AM
code_lover code_lover is offline
Authorized User
 
Join Date: Jan 2007
Posts: 46
Thanks: 2
Thanked 1 Time in 1 Post
Default 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
Reply With Quote