Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
| Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 25th, 2009, 07:41 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Improve on this code...? niallhannon Pro VB 6 7 February 24th, 2007 01:47 PM
how to improve this code? dhaval229 SQL Language 0 February 20th, 2006 04:38 AM
how to improve this code? dhaval229 SQL Language 0 February 20th, 2006 04:36 AM
How to Improve Myself in ASP ranuji BOOK: Access 2003 VBA Programmer's Reference 4 April 22nd, 2005 08:53 AM
How do i improve the performance of report syedjavid Crystal Reports 4 October 26th, 2003 05:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.