CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2013
    Posts
    1

    Post 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

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    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

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: bank project c++

    Quote Originally Posted by VictorN View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured