struct array .. Read file from file

The assignment is about Sales of Traditional Candy from your country for International Food Fair:
Create 2 files using NotePad to read data of 5 types candies/cookies
1- first file keeps name of candies/cookies and its prices per pack.
2 - second file keeps sales of the five candies/cookies (in packs) for Monday, Tuesday and Wednesday 
- First, open the first file, read in the candies and its prices into an array of structures. Close the first file.
- Second, open the second file and read the number of packs sold for the three days of the food fair into the same structured array. Close the second file
- Third step, calculate the total sales in RM for the each type of candy/cookie.
- Fourth step, open an output stream  file and store the name of candies/cookies and the total sales. Close the third file.


suppose file1;

Snickers 20
Twizzlers 30
KitKat 54
Jelly Belly 34
Butterfinger 23

file 2;


Snickers 3 5 7
Twizzlers 4 6 9
KitKat 7 5 8
Jelly Belly 3 3 2
Butterfinger 2 5 1

Last edited on
don't double-post and the same applies as here:
http://www.cplusplus.com/forum/general/214795/
Topic archived. No new replies allowed.