943,879 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 298
  • C++ RSS
Jul 14th, 2009
0

pointers and classes

Expand Post »
Hi:
How can I write a program using pointers and classes. My program suppose to translate dollar amounts in the range 0 through 9999 into an English description of the number. For example, the number 710 could be translated into the string seven hundred thirteen, and 8203 would be translated into eight thousand two hundred three, etc.

Any ideaa?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ladykaelin is offline Offline
2 posts
since Jul 2009
Jul 14th, 2009
0

Re: pointers and classes

Why would you need to use a pointer for this programming task?
I think a recursive function will do fine here.
It's only a small range you have to translate, so a recursive function will be the easiest in my opinion
Also: use arrays to store the numbers (in their expanded form, like: "one", "two", "three", ... , "ten", "twenty", "forty", etc. ...)
Last edited by tux4life; Jul 14th, 2009 at 10:02 am.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
Jul 14th, 2009
0

Re: pointers and classes

I need to use pointers for this program because my instructor wants to.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ladykaelin is offline Offline
2 posts
since Jul 2009
Jul 14th, 2009
0

Re: pointers and classes

Just try to do the program,
when its done, it should be clear what should be pointers.
Reputation Points: 70
Solved Threads: 9
Junior Poster
monkey_king is offline Offline
160 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Send data over network
Next Thread in C++ Forum Timeline: Help!My first C++ class is messed up!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC