Connecting Tech Pros Worldwide Forums | Help | Site Map

need help on this inheritance problem about phones..

Newbie
 
Join Date: Jan 2007
Posts: 16
#1: Oct 22 '09
hi all.
i am just starting doing this idea of inheritance handphones of oop c++..
but this uml diagram below got some weird symbols like
inbox:string[N*]
mms_inbox:image[N]
what is it?
it sure is not c++..
any guide help to my questions..
below the uml is my handwritten coding from uml to brief c++...
is my coding ok?
can it be compilable?
even i have my doubts looking at how weird the uml is...
Quote:
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..
Expand|Select|Wrap|Line Numbers
  1. class Handphone
  2. {
  3. private:
  4.  
  5. string phoneNumber;
  6. string message;
  7.  
  8. double credit;
  9.  
  10. string[N*] inbox;
  11.  
  12. int object counter;
  13.  
  14.  
  15.  
  16. public:
  17.  
  18. Handphone ( string no, double cr,double rate)
  19.  
  20. void smsEdit();
  21.  
  22. void smsRead();
  23.  
  24.  
  25. }
  26.  
  27.  
  28. Class Smartphone : public Handphone
  29. {
  30. private:
  31.  
  32. image mms_message;
  33. image[N] mms_inbox;
  34. public:
  35.  
  36. void operator>>(Smartphone &s);
  37.  
  38. void mmsRead();
  39.  
  40. void mmsEdit();
  41.  
  42.  
  43.  
  44.  
  45.  
  46. }

Reply


Similar C / C++ bytes