pointers and classes

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2009
Posts: 2
Reputation: ladykaelin is an unknown quantity at this point 
Solved Threads: 0
ladykaelin ladykaelin is offline Offline
Newbie Poster

pointers and classes

 
0
  #1
Jul 14th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: pointers and classes

 
0
  #2
Jul 14th, 2009
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.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: ladykaelin is an unknown quantity at this point 
Solved Threads: 0
ladykaelin ladykaelin is offline Offline
Newbie Poster

Re: pointers and classes

 
0
  #3
Jul 14th, 2009
I need to use pointers for this program because my instructor wants to.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 149
Reputation: monkey_king is on a distinguished road 
Solved Threads: 8
monkey_king monkey_king is offline Offline
Junior Poster

Re: pointers and classes

 
0
  #4
Jul 14th, 2009
Just try to do the program,
when its done, it should be clear what should be pointers.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC