Thread: My coding idea about inheritance for phones

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    61

    My coding idea about inheritance for phones

    well here i am just starting to do some coding about handphone to smartphone object..it's an inheritance project but not mine..
    so i would like to share here about the errors and others.
    any help is appreciated...
    now my uml diagram i want to transfer to handwritten coding.so..

    Handphone
    -phoneNumber:string
    -message: string
    -credit:double
    -sms_rate:double
    -inbox:string[N*]
    -object_counter:int
    +<<constructor>> Handphone(no:string, cr:double, rate:double)
    +smsEdit():void
    +smsRead():void
    +operator>>(recipient:Handphone&):void
    +getCredit():double
    +getObjCounter():int
    +operator+(topUp:double): Handphone



    Smartphone
    -mms_message:image
    -mms_inbox:image[N]
    +operator>>(:Smartphone):void
    +mmsRead():void
    +mmsEdit():void
    Fig. 2 Detail UML diagrams

    here's my work...any comments ideas or something..i think it's ok..
    Code:
    class Handphone
    {
    private:
    
    string phoneNumber;
    string message;
    
    double credit;
    
    string inbox[N*];
    
    int object_counter;
    
    
    
    public:
    
    Handphone ( string no, double cr,double rate)
    
    void smsEdit();
    
    void smsRead();
    
    
    }
    
    
    Class Smartphone : public Handphone
    {
    private:
    
    image mms_message;
    image mms_inbox[N];
    public:
    
    void operator>>(Smartphone &s);
    
    void mmsRead();
    
    void mmsEdit();
    
    
    
    
    
    }

    can anyone explain what is string[N*] inbox; and image[N] mms_inbox;
    what is the data type like?? why does it have a bracket?like[*] and [] the initial i suppose it's a pointer thing.
    Last edited by MyRedz; 10-22-2009 at 11:34 AM. Reason: correction of errors

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ coding idea
    By Bnorman in forum C++ Programming
    Replies: 15
    Last Post: 10-22-2009, 09:14 AM
  2. An idea that's out of my reach of knowledge
    By Akkernight in forum Tech Board
    Replies: 12
    Last Post: 04-08-2009, 09:35 PM
  3. Replies: 9
    Last Post: 03-20-2009, 05:22 PM
  4. Before Coding
    By cyberCLoWn in forum C++ Programming
    Replies: 16
    Last Post: 12-15-2003, 02:26 AM
  5. Inheritance vs Composition
    By Panopticon in forum C++ Programming
    Replies: 11
    Last Post: 01-20-2003, 04:41 AM