Deadline is 20th of May 23.59 Homework is about files. It has to be written in C language. Thanks. Course1.txt is: Ogren
Posted: Fri May 20, 2022 3:19 pm
Deadline is 20th of May 23.59 Homework is about files. It has to be written in C language. Thanks.
Course1.txt is:
Ogrenci No;Ogrenci;Program;Sinif;Email;Status
10000000000;EDA NUR YILMAZ;Computer Engineering;4;[email protected];
10000000010;FEYZA NUR DUMAN;Computer Engineering;2;[email protected];
20000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
30000000030;CEREN AYDINLI;Computer Engineering;2;[email protected];
30000000010;DURU YAMAC;Computer Engineering;3;[email protected];
40000000010;SEVIL TERZI;Computer Engineering;2;[email protected];W
50000000010;EREN AYDIN;Computer Engineering;2;[email protected];
50000000020;YAMAC YILMAZ;Computer Engineering;2;[email protected];
60000000020;EDANUR YILMAZ;Computer Engineering;2;[email protected];
70000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
Course2.txt is :
Ogrenci No;Ogrenci;Program;Sinif;Email;Status
70000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
10000000000;EDA NUR YILMAZ;Computer Engineering;4;[email protected];
60000000020;EDANUR YILMAZ;Computer Engineering;2;[email protected];
11000000010;FEYZA NUR DUMANLI;Computer Engineering;2;[email protected];
31000000030;CEREN AYDIN;Computer Engineering;2;[email protected];
31000000010;DURU AMAC;Computer Engineering;3;[email protected];
80000000010;YESIM KAMA;Computer Engineering;2;[email protected];
50000000010;EREN AYDIN;Computer Engineering;2;[email protected];
PROGRAM HAS TO EXECUTABLE FROM THE COMMAND LINE
Thank you so much
The first line of the input file is a header line which includes title of each column of the data file. Each of the remaining lines includes a record of a student registered to the course. • Ogrenci No 11-digits Student ID o Students are uniquely recognized by their ID. • Ogrenci o Name & surname (written in all uppercase letters) o Name of a student might include more than one word but surname is always a single word at the end of name & surname. Assume that there are one or more space characters between words in name & surname. • Regarding EDA NUR YILMAZ, YILMAZ is the surname and there are two names, which are EDA and NUR. • Regarding EDANUR YILMAZ, YILMAZ is the surname and there is a single name, which is EDANUR. • Program o Program of the student • Sinif o Year of the student • Email Email address (written in all lowercase letters) o Students are uniquely recognized by their email addresses. Status o Status showing whether the student withdrew the course o W if the student withdrew the course. Otherwise, it is empty. Assume that the number of students in a course is at most 500. How to run the program: Your program shall be executed from the command line as below using 4 command line arguments: >hw.exe <InputFileName1> <InputFileName> <OutputFileName> <Operation> where each command line argument is described as below: <InputFileName1> : 1st argument is name of the first input file, i.e. name of the file containing records of students registered to the first course. <inputFileName2>2nd argument is name of the second input file, i.e. name of the file containing records of students registered to the second course. <OutputFileName>: 3rd argument is name of output file. .
Sample run 2: > hw.exe course1.txt course2.txt course_1_2_union.txt -u The content of course_1_2_union.txt is as follows: 1: AMAC, DURU, Computer Engineering, 3, duru.amac@ 2: AYDIN, CEREN, Computer Engineering, 2, ceren.aydin@ 3: AYDIN, EREN, Computer Engineering, 2, eren.aydin@ 4: AYDINLI, CEREN, Computer Engineering, 2, ceren.aydinli 5: DUMAN, FEYZA NUR, Computer Engineering, 2, fnur.duman 6: DUMANLI, FEYZA NUR, Computer Engineering, 2, fnur.dumanli@ 7: KAMA, YESIM, Computer Engineering, 2, yesim.kama 8: TERZI, SEVIL, Computer Engineering, 2, sevil.terzi 9: YAMAC, DURU, Computer Engineering, 3, duru.yamace 10: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamac18 11: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamace 12: YILMAZ, EDA NUR, Computer Engineering, 4, enur.yilmaz@ 13: YILMAZ, EDANUR, Computer Engineering, 2, edanur.yilmaz 14: YILMAZ, YAMAC, Computer Engineering, 2, yamac.yilmaz Format of the output file Each line of the output file contains the information about each student in the following format: <Line Number: <Surname>, <Name(s)>, <Program>, <Year>, <Email Note that when there are multiple names of a student, they are separated by a single space in the output file. Hints You can use any available string sorting algorithm in your source code in the literature, but your source code is expected to be comprised by only 1 source file (so all your functions including the sorting function should be in the same file). In this homework, you are mainly expected to use your skills from Chapter 8 Strings of the book. Check out string.h library functions. Check also character functions available in ctype.h. You may also consider using fgets, fputs functions under stdio.h, if applicable to your solution.
In this assignment, you are going to write a C program that reads, processes and displays records of students registered to courses in a university. Your program reads two input files. Each file contains records of students registered to a particular course. Your program produces an output file which contains information about list of students registered to both of the courses intersection) or either of the courses (union). List of students registered to each course is provided as a text file. Getting to know input file: A sample input file (course1.txt) is given as follows: Ogrenci No;Ogrenci; Program; Sinif;Email;Status 10000000000; EDA NUR YILMAZ;Computer Engineering;4; enur.yilmaz@ 10000000010; FEYZA NUR DUMAN; Computer Engineering;2;fnur.duman@ 20000000010; GOKHAN YAMAC; Computer Engineering;2; gokhan.yamac@ 30000000030; CEREN AYDINLI; Computer Engineering;2;ceren.aydinli@ 30000000010; DURU YAMAC; Computer Engineering;3; duru.yamac@ 40000000010;SEVIL TERZI; Computer Engineering;2; sevil.terzi@ 50000000010; EREN AYDIN; Computer Engineering;2;eren.ayding 50000000020; YAMAC YILMAZ; Computer Engineering;2; yamac.yilmaz@ 60000000020;EDANUR YILMAZ;Computer Engineering;2;edanur.yilmaz@ 70000000010; GOKHAN YAMAC; Computer Engineering;2; gokhan.yamac18@ Another sample input file (course2.txt) is given as follows: Ogrenci No;Ogrenci;Program;Sinif;Email;Status 70000000010; GOKHAN YAMAC;Computer Engineering;2; gokhan.yamac 18@ 10000000000;EDA NUR YILMAZ; Computer Engineering;4; enur.yilmaz@ 60000000020;EDANUR YILMAZ; Computer Engineering;2;edanur.yilmaz@1 11000000010; FEYZA NUR DUMANLI;Computer Engineering;2;fnur.dumanli@ 31000000030;CEREN AYDIN; Computer Engineering;2;ceren.ayding 31000000010;DURU AMAC;Computer Engineering;3; duru.amac@ 80000000010;YESIM KAMA;Computer Engineering;2;yesim.kama@ 50000000010;EREN AYDIN; Computer Engineering;2;eren.aydin@ ;W
<Operation>: 4th argument is the operation we would like to have. If it is -, the operation is intersection and the output file contains information about list of students registered to both of the courses. If it is -u, the operation is union and the output file contains information about list of students registered to either of the courses. What the program is expected to do: Your program is supposed to do the following tasks: 1. Read the first input file so that store ID, name, surname, program, year, email and status for each student registered to the first course. 2. Read the second input file so that store ID, name, surname, program, year, email and status for each student registered to the second course. 3. Find the list of students whose information is to be written to the output file. o If the operation is intersection, then find the list of students registered to both the first course and the second course. You could use ID or email fields to check whether two students are the same or not. o If the operation is union, then find the list of students registered to either the first course or the second course. Note that, in this list, each student must appear only once. You could use ID or email fields to check whether two students are the same or not. 4. Write the information about the list of students found in the previous step to the output file in a sorted way. . The students are sorted according to their surnames. o If surnames of the students are the same, they are sorted according to their names. If both sumames and names of the students are the same, they are sorted according to their email addresses. Sample Runs: Sample run 1: >hw.exe course1.txt course2.txt course_1_2_intersect.txt - The content of course_1_2_intersect.txt is as follows: 1: AYDIN, EREN, Computer Engineering, 2, eren.aydin@ 2: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamac 18@ 3: YILMAZ, EDA NUR, Computer Engineering, 4, enur.yilmaz@ 4: YILMAZ, EDANUR, Computer Engineering, 2, edanur.yilmaz@
Course1.txt is:
Ogrenci No;Ogrenci;Program;Sinif;Email;Status
10000000000;EDA NUR YILMAZ;Computer Engineering;4;[email protected];
10000000010;FEYZA NUR DUMAN;Computer Engineering;2;[email protected];
20000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
30000000030;CEREN AYDINLI;Computer Engineering;2;[email protected];
30000000010;DURU YAMAC;Computer Engineering;3;[email protected];
40000000010;SEVIL TERZI;Computer Engineering;2;[email protected];W
50000000010;EREN AYDIN;Computer Engineering;2;[email protected];
50000000020;YAMAC YILMAZ;Computer Engineering;2;[email protected];
60000000020;EDANUR YILMAZ;Computer Engineering;2;[email protected];
70000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
Course2.txt is :
Ogrenci No;Ogrenci;Program;Sinif;Email;Status
70000000010;GOKHAN YAMAC;Computer Engineering;2;[email protected];
10000000000;EDA NUR YILMAZ;Computer Engineering;4;[email protected];
60000000020;EDANUR YILMAZ;Computer Engineering;2;[email protected];
11000000010;FEYZA NUR DUMANLI;Computer Engineering;2;[email protected];
31000000030;CEREN AYDIN;Computer Engineering;2;[email protected];
31000000010;DURU AMAC;Computer Engineering;3;[email protected];
80000000010;YESIM KAMA;Computer Engineering;2;[email protected];
50000000010;EREN AYDIN;Computer Engineering;2;[email protected];
PROGRAM HAS TO EXECUTABLE FROM THE COMMAND LINE
Thank you so much
The first line of the input file is a header line which includes title of each column of the data file. Each of the remaining lines includes a record of a student registered to the course. • Ogrenci No 11-digits Student ID o Students are uniquely recognized by their ID. • Ogrenci o Name & surname (written in all uppercase letters) o Name of a student might include more than one word but surname is always a single word at the end of name & surname. Assume that there are one or more space characters between words in name & surname. • Regarding EDA NUR YILMAZ, YILMAZ is the surname and there are two names, which are EDA and NUR. • Regarding EDANUR YILMAZ, YILMAZ is the surname and there is a single name, which is EDANUR. • Program o Program of the student • Sinif o Year of the student • Email Email address (written in all lowercase letters) o Students are uniquely recognized by their email addresses. Status o Status showing whether the student withdrew the course o W if the student withdrew the course. Otherwise, it is empty. Assume that the number of students in a course is at most 500. How to run the program: Your program shall be executed from the command line as below using 4 command line arguments: >hw.exe <InputFileName1> <InputFileName> <OutputFileName> <Operation> where each command line argument is described as below: <InputFileName1> : 1st argument is name of the first input file, i.e. name of the file containing records of students registered to the first course. <inputFileName2>2nd argument is name of the second input file, i.e. name of the file containing records of students registered to the second course. <OutputFileName>: 3rd argument is name of output file. .
Sample run 2: > hw.exe course1.txt course2.txt course_1_2_union.txt -u The content of course_1_2_union.txt is as follows: 1: AMAC, DURU, Computer Engineering, 3, duru.amac@ 2: AYDIN, CEREN, Computer Engineering, 2, ceren.aydin@ 3: AYDIN, EREN, Computer Engineering, 2, eren.aydin@ 4: AYDINLI, CEREN, Computer Engineering, 2, ceren.aydinli 5: DUMAN, FEYZA NUR, Computer Engineering, 2, fnur.duman 6: DUMANLI, FEYZA NUR, Computer Engineering, 2, fnur.dumanli@ 7: KAMA, YESIM, Computer Engineering, 2, yesim.kama 8: TERZI, SEVIL, Computer Engineering, 2, sevil.terzi 9: YAMAC, DURU, Computer Engineering, 3, duru.yamace 10: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamac18 11: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamace 12: YILMAZ, EDA NUR, Computer Engineering, 4, enur.yilmaz@ 13: YILMAZ, EDANUR, Computer Engineering, 2, edanur.yilmaz 14: YILMAZ, YAMAC, Computer Engineering, 2, yamac.yilmaz Format of the output file Each line of the output file contains the information about each student in the following format: <Line Number: <Surname>, <Name(s)>, <Program>, <Year>, <Email Note that when there are multiple names of a student, they are separated by a single space in the output file. Hints You can use any available string sorting algorithm in your source code in the literature, but your source code is expected to be comprised by only 1 source file (so all your functions including the sorting function should be in the same file). In this homework, you are mainly expected to use your skills from Chapter 8 Strings of the book. Check out string.h library functions. Check also character functions available in ctype.h. You may also consider using fgets, fputs functions under stdio.h, if applicable to your solution.
In this assignment, you are going to write a C program that reads, processes and displays records of students registered to courses in a university. Your program reads two input files. Each file contains records of students registered to a particular course. Your program produces an output file which contains information about list of students registered to both of the courses intersection) or either of the courses (union). List of students registered to each course is provided as a text file. Getting to know input file: A sample input file (course1.txt) is given as follows: Ogrenci No;Ogrenci; Program; Sinif;Email;Status 10000000000; EDA NUR YILMAZ;Computer Engineering;4; enur.yilmaz@ 10000000010; FEYZA NUR DUMAN; Computer Engineering;2;fnur.duman@ 20000000010; GOKHAN YAMAC; Computer Engineering;2; gokhan.yamac@ 30000000030; CEREN AYDINLI; Computer Engineering;2;ceren.aydinli@ 30000000010; DURU YAMAC; Computer Engineering;3; duru.yamac@ 40000000010;SEVIL TERZI; Computer Engineering;2; sevil.terzi@ 50000000010; EREN AYDIN; Computer Engineering;2;eren.ayding 50000000020; YAMAC YILMAZ; Computer Engineering;2; yamac.yilmaz@ 60000000020;EDANUR YILMAZ;Computer Engineering;2;edanur.yilmaz@ 70000000010; GOKHAN YAMAC; Computer Engineering;2; gokhan.yamac18@ Another sample input file (course2.txt) is given as follows: Ogrenci No;Ogrenci;Program;Sinif;Email;Status 70000000010; GOKHAN YAMAC;Computer Engineering;2; gokhan.yamac 18@ 10000000000;EDA NUR YILMAZ; Computer Engineering;4; enur.yilmaz@ 60000000020;EDANUR YILMAZ; Computer Engineering;2;edanur.yilmaz@1 11000000010; FEYZA NUR DUMANLI;Computer Engineering;2;fnur.dumanli@ 31000000030;CEREN AYDIN; Computer Engineering;2;ceren.ayding 31000000010;DURU AMAC;Computer Engineering;3; duru.amac@ 80000000010;YESIM KAMA;Computer Engineering;2;yesim.kama@ 50000000010;EREN AYDIN; Computer Engineering;2;eren.aydin@ ;W
<Operation>: 4th argument is the operation we would like to have. If it is -, the operation is intersection and the output file contains information about list of students registered to both of the courses. If it is -u, the operation is union and the output file contains information about list of students registered to either of the courses. What the program is expected to do: Your program is supposed to do the following tasks: 1. Read the first input file so that store ID, name, surname, program, year, email and status for each student registered to the first course. 2. Read the second input file so that store ID, name, surname, program, year, email and status for each student registered to the second course. 3. Find the list of students whose information is to be written to the output file. o If the operation is intersection, then find the list of students registered to both the first course and the second course. You could use ID or email fields to check whether two students are the same or not. o If the operation is union, then find the list of students registered to either the first course or the second course. Note that, in this list, each student must appear only once. You could use ID or email fields to check whether two students are the same or not. 4. Write the information about the list of students found in the previous step to the output file in a sorted way. . The students are sorted according to their surnames. o If surnames of the students are the same, they are sorted according to their names. If both sumames and names of the students are the same, they are sorted according to their email addresses. Sample Runs: Sample run 1: >hw.exe course1.txt course2.txt course_1_2_intersect.txt - The content of course_1_2_intersect.txt is as follows: 1: AYDIN, EREN, Computer Engineering, 2, eren.aydin@ 2: YAMAC, GOKHAN, Computer Engineering, 2, gokhan.yamac 18@ 3: YILMAZ, EDA NUR, Computer Engineering, 4, enur.yilmaz@ 4: YILMAZ, EDANUR, Computer Engineering, 2, edanur.yilmaz@