Question
The first part of the argument list indicates the subject files to be used. This is followed by a special marker student. Then a list
The first part of the argument list indicates the subject files to be used. This is followed by a special marker student. Then a list of student ID follows. Each subject file starts with a line of 4 entries: the word Subject, the subject code, the academic year and the semester that the subject is/was offered. Each of the subsequent lines contains the ID of a student and the grade. For subjects in the current semester, there is no grade for the students. To facilitate the checking of students, there is a special file called student.dat. Each line of this file contains the ID of a student and the name. For simplicity, there are only two semesters in each academic year. You can assume that there is no error in the information contained in all the files.Here, COMP101121S2.dat and COMP241122S1.dat are the names of subject files, and 1234 is the ID of the student whose transcript is to be generated. The two lists are separated by the special marker student. The use of wildcard character * can also be used in the list of subject files. However, it would not be used in the list of student ID. Typical file contents are shown below:
Filename | Content |
student.dat | 1223 bob 1224 kevin 1225 stuart 1226 otto 1234 john 1235 mary 1236 peter 1237 david 1238 alice |
COMP101121S2.dat | Subject COMP1011 2021 2 1223 F 1234 B 1235 B+ 1236 A |
COMP101122S1.dat | Subject COMP1011 2022 1 1223 B 1224 B+ 1225 B 1238 C+ |
COMP241122S1.dat | Subject COMP2411 2022 1 1223 C+ 1234 B 1235 B 1236 A |
COMP243222S2.dat | Subject COMP2432 2022 2 1223 1235 1236 1237 |
Sample outputs (formatting is not important):
transcript COMP101121S2.dat COMP241122S1.dat student 1234 |
Transcript for 1234 john COMP1011 2021 Sem 2 B COMP2411 2022 Sem 1 B GPA for 2 subjects 2.85 |
Please write c program to answer this question
Laboratory Exercise (optional) Making use of your script program transcript in Lab 3, develop a C version of the program performing the same functionality with the same interface. In other words, develop a program transcript.c which after compilation will produce an executable file transcript that will be used in exactly the same way as the script program transcript in Lab 3 (so that the user of the program cannot distinguish which one they are now using, except that they can find out the file type via the Unix file command or look inside the file for the magic number). In particular, the program would be run like: transcript COMP* student 123612341223 Here, all files contain the same information in the same format as in Lab 3. Again, the output of your program would look like (and it is easier to format in C): Transcript for 1236 peter COMP1011 2021 Sem 2 A COMP2411 2022 Sem 1 A COMP2432 2022 Sem 2 GPA for 2 subjects 4.00 Transcript for 1234 john COMP1011 2021 Sem 2 B COMP2411 2022 Sem 1 B- GPA for 2 subjects 2.85 Transcript for 1223 bob COMP1011 2021 Sem 2F COMP1011 2022 Sem 1B COMP2411 2022 Sem 1C+ COMP2432 2022 Sem 2 GPA for 2 subjects 2.65 In the C program, most of the processing logic in your original script program can be retained, though expressed in different syntax under different data structures. Try to compare the way you program the different functionality for the two versions and observe the difference. This would give you a better understanding on the relative strength and weakness between writing a script versus a standard program to carry out some simple tasks. For instance, perhaps script is better in handling simple file I/O with text, and standard program is better to handle internal processing logic. Name your program transcript.c and submit it via BlackBoard on or before 10 March 2023 , to claim participation scoreStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started