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.
string cookie_name;
double cookie_price;
int first_sell;
int second_sell;
int thirdz_sell;
};
int main()
{
//now need to read the first file and into this struct.
//then second file
//then need to calculate the total sell within three days.
//then need to write he outstream file inclue cookie name, total sell and so on
//cookie name and price first file:
/*
KitKat 54.88
Jellyt 34.88
Butter 23.89
Snicke 20.78
Twizzl 30.67