In article <3r278tFhjtorU1@individual.net>,
osmium <r124c4u102@comcast.net> wrote:[color=blue]
>"Willing 2 Learn" writes:
>[color=green]
>> I'm trying to learn how to use C++, the OO way. I need help with a
>> simple program im doing to convert currency by creating a class for
>> this ADT. I know it should have a header file, main program,program
>> with functions, Constructor with arguments; default constructor with no
>> arguments;add, subtract, scalar multiply;show. Also I want it to show
>> all the #'s in cents and not round to 2 decimal places. I am struggling
>> to see how to use all 3 of these to convert cents to dollars and vice
>> versa. I already have 2 variables dollars & cents & im thinking i need
>> to convert both to a single variable then do the math. After this point
>> im stuck. Could you help me please, I would be very grateful.[/color]
>
>The class should have only one datum:
>
>long cents;
>
>Convert as necessary, both input and output. The long might be a problem in
>a real program (too small) but it is OK to use in learning the
>fundamentals.[/color]
Also, don't know the OP motivation, but have a look at the
numeric and money capabilities found in <locale>
--
Greg Comeau / Celebrating 20 years of Comeauity!
Comeau C/C++ ONLINE ==>
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?