Question: Could somebody please, how to write this c++ program? Here are the fractions.cpp Start with the program fractions.cpp Modify it to 1. Dynamically allocate two

Could somebody please, how to write this c++ program?

Could somebody please, how to write this c++ program? Here are thefractions.cpp Start with the program fractions.cpp Modify it to 1. Dynamically allocate

Here are the fractions.cpp

two arrays to hold Fration structs and initialize data in each arrayfrom files The Fractions are created for each array by reading data

Start with the program fractions.cpp Modify it to 1. Dynamically allocate two arrays to hold Fration structs and initialize data in each array from files The Fractions are created for each array by reading data from two separate files The first value in each file is the size of the array Each data file contains a value indicating how many fractions are in the file, followed by the numerator and denominator for each. Elfractiondatalbt a fractiondata2tt E3 2 2 3 3 1 4 3 1 4 4 3 4 4 1 2 5 1 12 5 4 11 2 5 6 2 12 7 29 7 29 8 3 7 8 5 8 9 2 3 9 2 7 100 2 3 10 2 3 2. Construct a method that takes an array of Fractions and outputs the contents. Use the tostring method to print each fraction void printFractions(Fraction fractions) 3. Construct methods to add, subtract, multiply, and divide two Fractions and return a Fraction that represents the result. For example, here is a signature for an add method: Fraction add(Fraction &op1, Fraction &op2); (If you want to experiment with sending pointers to Fraction structs and dynamically allocating the result struct, you are welcome to do that 4. Loop through your Fraction arrays and output the result of applying each operation (add, subtract, multiply, and divide) to the Fractions at parallel positions in the arrays. Fraction result add (fractions1.fractions Oil, fractions2.fractions [i]) cout

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!