Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Step 3 File IO please do main.cpp Big decimal.cpp and the rest Make a change to your BigDecimal class to add the following functions (
Step File IO please do main.cpp Big decimal.cpp and the rest
Make a change to your BigDecimal class to add the following functions methods
int wholeNumber Returns only the whole number portion of the decimal
number as an int
double fraction Returns the fractional portion of the number as double
File IO
Attached at this link is a text file called Numbers.txt that contains several numbers.
You are to read in each of these numbers and store them in your BigDecimal class.
Basically you are going to need a BigDecimal class for each number that is in the file.
Store each BigDecimal in some kind of container like a vector or an ArrayList.
Once you have all of the numbers loaded use a loop to write out all of the numbers
into two separate text files. One file called wholeNumbers.txt will hold the whole
number portion of the number. The other file call fraction.txt will hold the fractional
portion of the number. Make sure you include the decimal point.
Open each of the files in Notepad and make sure that you have one number per line.
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