Student achievement file management system
1, Experimental requirements
1. Student information input, including student number, name, major, score of four courses, total score and ranking;
2. The system can browse, add, delete and modify student information;
3. The ranking and information output are determined according to the student's grades, including two-way bubble sorting, Hill sorting, quick sorting and heap sorting.
4. It is required to query the student information according to the student number or name;
5. Information modification can only modify the scores of four courses;
6. File access student information.
2, Programming language and development environment
c++
Visual Studio 2019
3, Project design ideas
1. Analyze the needs of student achievement file system and make system design
2. Define a stu structure, which contains the attributes of major, student number, name, major achievement, C + + achievement, College English achievement, high score and total score. Declare the friend function as public type, and declare the friend functions of input, statistics, search, modification, deletion, addition, sorting and display respectively.
class Student { private: char classroom[20]; //major int num; //Student ID char name[20]; //full name float physics; //College Physics float c_program; //C++ float english; //College English float math; //Advanced mathematics float sum; //Total score int order; public: friend void Input(Student stu[]); friend void Statistic(Student stu[]); friend void Lookup(Student stu[]); friend void Modify(Student stu[]); friend void Delete(Student stu[]); friend void Output(Student stu[]); friend void Insert(Student stu[]); friend void Sort(Student stu[]); friend void Write(Student stu[], int n); friend int Read(Student stu[]); }stu[100];
3. Write menu
Input student information (including student number, name, major and 4 course scores)
Browse student information (browse the information sorted by students)
Find student information (find a qualified record)
Modify student information (only modify student scores)
Delete student information (delete the information of the specified student and give the user the option to retrieve the specified item)
New student information (including student number, name, major and 4 course scores)
Sort by total score (two-way bubble sort, Hill sort, quick sort, heap sort)
Save student information (save student grade file information to text file)
Load student information (after logging in to the system, read the student score information saved in the disk file into memory)
int menu() { char c; do { system("cls"); cout << "******************************************************" << endl; cout << "----------------Welcome to the student achievement management system---------------" << endl; cout << " * [1]Enter student grade * " << endl; cout << " * [2]Display statistics * " << endl; cout << " * [3]Find student grades * " << endl; cout << " * [4]Modify student grades * " << endl; cout << " * [5]Delete student grade * " << endl; cout << " * [6]Insert student grade * " << endl; cout << " * [7]By total score * " << endl; cout << " * [8]Show student grades * " << endl; cout << " * [0]Exit management system * " << endl; cout << "******************************************************" << endl; cout << "Please select your action (0-8):" << endl; c = getchar(); } while (c < '0' || c > '8'); return (c - '0'); }
4. Principal function design
int main() { for (;;) { switch (menu()) { case 1: Input(stu); break; case 2: Statistic(stu); break; case 3: Lookup(stu); system("pause"); break; case 4: Modify(stu); system("pause"); break; case 5: Delete(stu); system("pause"); break; case 6: Insert(stu); system("pause"); break; case 7: Sort(stu); system("pause"); break; case 8: Output(stu); system("pause"); break; case 0: cout << endl << "================Thank you for using the student achievement management system==============\n" << endl; exit(0); } } return 0; }