Question: C++ steps 3 write the c++ in classes Step 3 File IO Make a change to your BigDecimal class to add the following functions (methods)

C++ steps 3

write the c++ in classes

Step 3 File IO

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.

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.

attached a text file called numbers.txt

29.0636762609840342.7738373771088518.09188777508393326.0058085130157927.37338584152473722.95083826257936447.8500302249425116.7596352281828225.39104706857689241.62120302447418438.90082900790484614.96556213172988247.3596666493755434.693005581633421.3408339329026924.62597313734923436.5501555038554528.6179313191587147.0350318470005822.54712998907773510.35425599837467740.5296035537819715.7579873889200741.9880254105102321.9944722764102412.7189540277913949.5566177060405326.94328724070033221.9528285431020517.76133123525811234.00279821850186647.8474673312636127.41555416022819746.1178697278561713.32434100554694523.12090388755356739.4761475516938149.7914180734737810.973164695143430.86010996667979415.53454883087745143.6251870923108328.00983088959585421.10849817493148728.275486658560840.09004680971112648.7538848998763711.52603772804000442.80435619972731613.9142407118703716.46979206811588327.90926104592772839.9643293248234139.667083736782445

11.42855621950090515.89585003380379126.55367261056494518.41603809995655229.50540996286250521.32083357740114242.10758794353789448.834350593261921.5443056677129334.0742711959843237.1041938848366623.6442764087480312.04021740508566513.94306106297159418.899584675800344.03869994304053410.26060060304682346.8023731305889919.3921979184341722.73179197168101217.7476624005267735.65499166402058532.36206247886996630.54714828936376543.2133913547041613.39966041016559818.6257837103233911.95967792257930319.15964046825079232.84236504891785623.5934567894931211.7652968836179234.12583741635112544.34726613341385434.5089967646560318.06033151664771530.2872265986012412.6568318213353523.60069244926653215.9703138495345728.19686305651421431.79351915676152638.56410552770946522.075682794784928.78486884666745410.588169721472148

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!