Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
BigDecimalString 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 setValuechar ch A char that contains a digit
void setValueString value This does the same as the overloaded constructor that takes a string
BigDecimal addBigDecimal Adds the values together and returns the result as a Big Decimal
BigDecimal subBigDecimal 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 atint index Returns the value at the particular index as a Char
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started