Question: Compute the total value of the orders in the two files from the previous exercise. The value of an individual Purchase is (of course) its
Compute the total value of the orders in the two files from the previous exercise. The value of an individual Purchase is (of course) its unit_price*count.
Data from Previous Exercise
Define an Order class with (customer) name, address, data, and vector members. Purchase is a class with a (product) name, unit_price, and count members. Define a mechanism for reading and writing Orders to and from a file. Define a mechanism for printing Orders. Create a file of at least ten Orders, read it into a vector, sort it by name (of customer), and write it back out to a file. Create another file of at least ten Orders of which about a third are the same as in the first file, read it into a list, sort it by address (of customer), and write it back out to a file. Merge the two files into a third using std::merge().
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
To compute the total value of the orders in the two files from the previous exercise you can follow ... View full answer
Get step-by-step solutions from verified subject matter experts
