Hi
Could somebody help me doing this question...:confused:
I'm a beginner in c++........
TQ:):):):):)

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

1. Constructor initializes the phoneNumber (default value 012345), credit (default value 50) and sms_rate (default value 2.5). It also increment the object_counter each time an object is created.
2. smsEdit() allows us to edit sms text freely up to 160 characters. After completing edit, the composed sms can be stored in the phone memory as message before being sent to the recipient.
3. smsRead()reads received messages from the inbox.
4. Operator>>()allows us to send sms message to intended recipient.However, here we can only specify the recipient by the object name, rather than the phone number. (It can be done but quite complicated. You are welcome to challenge it for extra marks!)
5. getCredit() checks the balance of the credit.
6. getObjCounter()checks the number of existing object.
7. operator+() tops up the credit with specified amount.

Recommended Answers

All 2 Replies

Could somebody help me doing this question...

Yes, post down your code and tell us what you've problems with to achieve.

Have you got modem with sim ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.