lab3 - id1,id2,day,month,year,shift,hour,minute,w,f,sample)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <stdio.h> #include <stdlib.h> #include <math.h> #define filename "machine_samples_0.dat" #define Filename "manufacture.cvs" #define FILENAME "manufacture_report.txt" int main() { int id1,id2,day,month,year,shift, hour,minute,w,f,sample,LINE=0,countshift1=0,countshift2=0, countshift3=0,ttlshftcount c FILE* machine_samples_0 FILE* manufacture FILE* manufacture_report F machine_samples_0 = fopen(filename, "r") manufacture = fopen(Filename, "w") manufacture_report = fopen(FILENAME, "w") fprintf(manufacture_report,"Machine\t\t\tDate\t\t\tShift\tTime" "\n-------\t\t\t----\t\t\t-----\t----\n") do { fscanf_s(machine_samples_0,"%05d%05d%02d%02d%4d%1d%02d%02d%1d%1d%05d", fprintf(manufacture,"%05d%05d,%02d/%02d/%4d,%1d,%02d:%02d,f%1d.%1d,%05d\n",
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: id1,id2,day,month,year,shift,hour,minute,w,f,sample) i fprintf(manufacture_report,"%05d%05d\t\t%02d/%02d/%4d\t\t%1d\t\t%02d:%02d\n", id1,id2,day,month,year,shift,hour,minute) i if(shift == 1) countshift1++ c if(shift == 2) countshift2++ if(shift == 3) countshift3++ c LINE=LINE++ }while(LINE < 96) printf("Files manufacture.cvs and manufacture_report.txt have been constructed.\n\n") p ttlshftcount = countshift1+countshift2+countshift3 fprintf(manufacture_report, "\nRecords Processed: %d\n\tShift 1: %d\tShift 2: %d\t Shift 3: %d", Sheet1 Page 2 ttlshftcount,countshift1,countshift2,countshift3) fprintf(manufacture_report, "\n\nEnd of Report") fclose(machine_samples_0) fclose(manufacture) fclose(manufacture_report) return EXIT_SUCCESS }...
View Full Document

This lab report was uploaded on 04/17/2008 for the course CS 1023 taught by Professor Kerstetter during the Spring '08 term at Western Michigan.

Page1 / 2

lab3 - id1,id2,day,month,year,shift,hour,minute,w,f,sample)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online