-
June 16th, 2013, 03:25 AM
#1
bank project c++
I am making this bank project in c++ and i am using classes.My problem is i cant understand to make relation of classes.i am making inheritance of account classs with current account class and saving account class.Now i hav to make compositon of account with customer class or sould i make compostion of both current and saving class in customer class.plz help its urgent
-
June 16th, 2013, 05:42 AM
#2
Re: bank project c++
You could implement member variables of the type "current account" and "saving account" for your customer class. So every instance of the customer would have both current and saving accounts.
Victor Nijegorodov
-
June 16th, 2013, 06:42 AM
#3
Re: bank project c++
Originally Posted by VictorN
You could implement member variables of the type "current account" and "saving account" for your customer class. So every instance of the customer would have both current and saving accounts.
Not really enough information, but conceptually, if the two account classes are derived from a single parent class, you could probably have a container such as a vector as a member of your customer class, that would contain all the accounts belonging to the customer. You may need a container for each account type depending on the requirements.
In the real world, customers can have multiple accounts, and accounts can belong to multiple customers, so you'll need to specify your requirements better.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|