HEADER: // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include #include // TODO: reference additional headers your program requires here // Exercise 4.cpp : Defines the entry point for the console application. //*******************************************************************// #include "stdafx.h" #include #include using namespace std; struct sales //structure for the sales file { int customer_number; char item[50]; char part_number[15]; float cost; char date[6]; }; sales mysales[200]; // initialise the sales struct /*********************************************************************** // // Functions // ***********************************************************************/ //given to us on the task page int get_field(FILE *file, char delimiter, char *ptr) { int length=0; char temp; while(1) { temp=fgetc(file); if (temp==EOF) return -1; if((temp==delimiter)||(temp==0x0A)) { ptr[length]='\0'; return length; } if(temp>0x1F) { ptr[length]=temp; length++; } } return -1; } //processes the data given through the get_field function float input(FILE *file, int *customerID, int size) { float total = 0; //initialises the count array elements to zero. int data; //initialises data for further use char buffer[100]; //This array will store each customer's number of purchases int id; int i, j=0; for (i=0; i