Money
class discussed in class. This class
should represent a dollar and cents amount with 0-99 cents and the cents
being the same sign as the dollars.
The class should at a minimum
have getter methods that return the dollars and cents, a toString()
method,
all reasonable constructors, addition and subtraction methods,
and a main()
method that provides a
thorough test of all the methods in the class. This should not be a hard problem. 90% of it was done for you in the third class.
toString()
method,
all reasonable constructors, and a main()
method that provides a
thorough test of all the methods in the class.
toString()
method,
and methods to add, subtract, and multiply two complex numbers, and
to return the real and imaginary parts.
You may wish to attempt to implement division, absolute value,
and argument methods as well. If so you will need to look ahead a little
to learn about java.lang.Math
. In particular, you'll need
the trigonometric and square root functions.