Write a program which print class report. There are 5 students in the class. Total subjects are 5 (Physics, Math, Computer Science, Islamiyat and Pak Studies) and every subject has 100 marks. Store student’s data in arrays.
Then create new file called “Stu_Data.txt” and store all students’ record in that file.
You have to do following tasks,
1. Enter full name of students, roll number and their subject marks.
2. Calculate average of each student and grade.
3. Calculate class average and grade.
Filing part:
4. Store data into the file
5. Retrieve data from the file
6. Search record from the file
Your program should start with the options given below:
1- Enter New Record 2- View Record 3- Search Record
Grading Scheme
Grade A when average is between 81 – 100
Grade B when average is between 60 – 79
Grade C when average is between 50 – 59
Grade D when average is between 33 – 49
Grade F when average is between 0 - 31
Your program flow should be like this. (In file “Stu_Data.txt” Data is also store in this manner)
Sample output
Class Report:
Student 1:
Name: Student Name
Roll No: 12345
Enter Subject Marks
Physics: 50
Math: 70
Computer Science: 80
Islamiyat: 85
Pak Studies: 75
------------------------------------------------
.
.
Student 5:
Name: Student Name
Roll No: 12345
Enter Subject Marks
Physics: 50
Math: 70
Computer Science: 80
Islamiyat: 85
Pak Studies: 75
------------------------------------------------
View Record:
Now call function “report_print” it will retrieve data from the file and print report.
Sample output
No.
Name
Roll No.
Physic
Math
Compuer Science
Islamiyat
Pak Studies
Average
Grade
1
Student Name
12345
50
60
70
76
90
81
A
2
Student Name
12345
55
52
50
80
58
55
C
3
Student Name
12345
85
66
90
88
77
75
B
4
Student Name
12345
40
70
91
45
56
85
A
5
Student Name
12345
30
80
80
55
93
45
D
Class Average is 56.55
Class Grade is D
Search Record:
Call function “Search_Record” and enter student id and search for that id in file “Stu_Data.txt” and retrieve that particular record from the file and display into the screen
Sample output
Enter Student ID: 2
No.
Name
Roll No.
Physic
Math
Compuer Science
Islamiyat
Pak Studies
Average
Grade
2
Student Name
12345
55
52
50
80
58
55
C