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

Info icon This 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", &id1,&id2,&day,&month,&year,&shift,&hour,&minute,&w,&f,&sample) fprintf(manufacture,"%05d%05d,%02d/%02d/%4d,%1d,%02d:%02d,f%1d.%1d,%05d\n",
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern