Assignment 242 SAh SH
Assignment 242 SAh SH
IMPORTANT: The following problem has five tasks with specific instructions. Please follow the instructions
exactly as given in the problem description.
You are trying to build and manage a student database for your class. Write a program to perform the
following tasks:
Subject2
Subject3
2. Take ten students’ information as input in an array struct student st[10]. Note that all inputs must be
taken from a file called “input.txt” using file operations. A sample is shown below:
Tamim
011221999
10 20 28 37
10 18 30 35
10 15 18 34
3.8
………………………
3. Print the stored data as output in file “output.txt”. Use the function void print(struct student st[]) to
print the data. A sample is shown below:
Student 1:
Name: Tamim
Id: 011221999
Subject 1 marks: 10 20 28 37
Subject 2 marks: 10 18 30 35
Subject 3 marks: 10 15 18 34
CGPA: 3.8
4. Print the total marks of each student for each subject in file “output.txt”. Use the function void
printtotal(struct student st[]) to perform this task. A sample is shown below:
5. Print the maximum and minimum CGPA of the class in file “output.txt”. Use the function
floatmaxCGPA(struct student st[]) and float minCGPA(stuct student st[]) to perform this task. A sample
is shown below:
IMPORTANT: You have to submit your source code, input file and output file. Make a zip file with all three and
upload using the link provided in LMS.