Question: Your BigDecimal class should have the following constructors BigDecimal ( ) - default constructor should simply set your container to three Char objects that contain

Your BigDecimal class should have the following constructors
BigDecimal()- default constructor should simply set your container to three Char objects that contain the values '0''.''0'
BigDecimal(String value)- This constructor will parse the string taking each digit, putting it into a new Char and adding the Char to the container.
Your BigDecimal class should also contain the following mutators
void setValue(char ch)- A char that contains a digit
void setValue(String value)- This does the same as the overloaded constructor that takes a string
BigDecimal add(BigDecimal)- Adds the values together and returns the result as a Big Decimal
BigDecimal sub(BigDecimal)- Subtracts the two values and returns the result as a BigDecimal
Note: If you are using C++ feel free to use the + operator instead of the add function.
I am going to let you off the hook for the multiply and divide but it should be easy to implement.
Accessors
double toDouble()- Returns the value stored in the container as a double
String toString()- Returns the value store in the container as a string
Char at(int index )- Returns the value at the particular index as a Char
 Your BigDecimal class should have the following constructors BigDecimal()- default constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!