| re: beginner c++ homework questions... if anyone knows how to do this, any help would be greatly appreciated TIA
On Sun, 09 May 2004 02:03:11 -0400, N3TB1N <4574L4V1574@60x.5K> wrote:
[color=blue]
>Here is my assignment. I am hoping that someone here quickly knows
>all of the correct answers...[/color]
In answer to your question, yes I do know all of the correct answers.
Depending on exctly what you want me to do, my rates go up to about
GBP 200 per hour.
[color=blue]
>especially for question #5 and everything after.[/color]
[color=blue]
>Thanks in advance.
>_________________________________________________ __________________________________________________ ________________
>
>class Money
>{
>public:
> friend istream& operator >> (istream& IS, Money& anAmount) ;
>
>private:
> int mDollars;
> int mCents;
>};
>[/color]
[snip][color=blue]
>
>4) Write a default constructor for the Money Class that initializes
>a Money object to $0.
>[/color]
I assume that you are reasonably confident about doing this.[color=blue]
>
>5) Overload the default constructor so that it takes two arguments,
>the first for the number of dollars and the second for the number of
>cents.
>[/color]
When you have anwered Q4, you will have a default constructor for the
Money Class that initialises a Money object to $0.00.
For Q5 you need to "overload" the constructor. If you don't
understand "overload" look it up or ask your instructor to explain.
Your overloaded constructor will have two arguments. If you don't
understand "argument" look it up or ask your instructor to explain.
Your first argument will be a number of dollars and your second
argument will be a number of cents.
Remember that this is an overloaded *constructor* so you are going to
have to think about what you are going to do with the two arguments
(one for dollars and the other for cents) in the context of
initialising a Money object.
When you have thought about that you should be in a position to write
the overloaded constructor that your instructor asked you for.
rossum
[color=blue]
>
>_________________________________________________ ___________-
>once again, thanks any help!
>
>--n3tb1n
>
>[/color]
--
The Ultimate Truth is that there is no Ultimate Truth |