Student management System--object-oriented programming

Source: Internet
Author: User

Basic management system of student information

An experimental purpose

The application of all the knowledge points in the course of C language programming, the development of a student information management system, the use of Computer Management of student information, and further improve the efficiency and modernization of school-running. For teachers and students to improve work efficiency, and realize the systematization of Student Information management workflow, Normalization and automation. Nowadays, the level of students ' information management is not very high in China's colleges and universities, and some of them still stay on the basis of the whole paper media, this kind of management can't adapt to the development of the Times, the society needs, because it wastes a lot of manpower and material resources, There are also many deficiencies. In today's information age, this traditional management method is bound to be replaced by a computer-based information management system. An efficient student information management system can store the previous student information files, do not need a large number of manpower, only a few special input staff can be operating system, save a lot of manpower, Can quickly find the required information, efficient, safe, students can easily view their information.

Two experimental contents and main tasks

Student information includes: School number, name, age, gender, date of birth, address, telephone, e-mail, etc. Try to design student information management system to provide the following functions:

1 ) Safety Module

2 ) Information Entry

3) information Browsing

4 ) Study number query

5 ) Name Query

6 ) Sorting Information

7 ) Information deletion

8 ) Information Modification

9 ) Save the file

Ten ) exit the system

One ) System Menu Display

Three experimental design and steps

Overall design:

    1. 1. The system can be divided into modules according to the function, the module diagram is as follows:

which

Information input module to complete the input function of student information, input information including student number, name, gender, date of birth, grade, professional. Address, telephone, etc. ;

Information browsing module to complete the display of student information entered;

Information Query module to complete the Student Information query, query should be by name and query by the number of two ways;

The information modification module completes the Student Information modification function;

Information deletion module to complete the deletion of student information function;

Security module is to enter the system requires user name and password;

The menu selects the module to complete the user command the reception, this module is also the staff information Management system entrance, the user needs to carry on the various operation all must choose in this module and then calls other modules realizes the corresponding function;

2 Data Structure

The main data structure in this system is the student's information, including student number, name, gender, date of birth, grade, professional, address, telephone, etc., in the process of each can be as a student's different attributes to deal with

3 Program Flow

The execution of the system should start from the selection of the Function menu, and follow the process according to the user's choice, until the user chooses to exit the system, and the user's choice should be judged and handled in the meantime. The flowchart of the system is as follows:

Detailed design:

corresponding to the overall design of the system function module diagram, the processing logic of each function module is as follows:

1 Safety Module

printf ("Please enter user name, \ n");

scanf ("%s", x);

if (strcmp (x, y) ==0)

{

printf ("Please enter a password, \ n");

scanf ("%d", &ma);

while (ma==123456)

By comparing the sentence to determine the correct input name and password if the correct access to the menu module;

2 Menu Module

Through the while statement

Give the information hint;

Clear screen;

Draw menus (including input, browse, query, modify, delete, sort, save, exit);

The prompt menu selects and reads into the variable;

Calling different module functions according to the value of the read-in variable;

3 Information Entry Module

Open File

while ()

{Clear screen;

Follow the prompts to enter various information;

While

Display various information;

By selecting 1. Confirm and Continue 2. Re-fill 3. Discard and return 4. Confirm and return

Choose four kinds of functions;

}

}

4 Information Browsing Module

Open File

while ()

{Clear screen;

Output student information sequentially in the For statement

You can flip the page by selecting 1. Previous 2. Next page 0. exit

}

5 Information Enquiry

while ()

{A menu-based selection is a study number query or a name

printf ("****** student information management system ******");

printf ("\ n----------Search----------");

printf ("\ n you want to:");

printf ("\ n 1. Search by study number");

printf ("\ n 2. Search by name");

printf ("\ n 3. Return to main Menu");

printf ("\n****************************\n");

}

If you choose to enter the study number module

By entering the study number

IF (study number exists continue)

{Output Student Information

}

Else Output no this student

If you select name to enter the name module

If (judging if the student exists based on the comparison name)

{Output Student Information

}

Else Output no this student

6 Deleting a module

While (continue to delete)

{

Prompt and read the student number of the student to be deleted;

Display the information you want to delete

}

Delete Succeeded

7 Information Modification Module

Enter the number of student information to be modified:

If (judging if there is this student)

{Menu Displays the item to be modified

printf ("\n1." Name 2. Age 3. Gender 4. Date of birth 5. Address 6. Phone 7.e-mail \ n ");

printf ("\n8. Math 9. English \ n");

}

Swich ()

{Select the item to modify for modification

}

8 Open File Module

void FileOpen ()

{

FILE *FP;

int n;

if ((Fp=fopen ("Data", "r+")) ==null)

Fp=fopen ("Data", "w+");

for (n=0;n<100;n++)

Fread (&stu[n],sizeof (struct student), 1,FP);

Fread (&STUNUM,4,1,FP);

Fclose (FP);

}

9 Saving a file module

void FileSave ()

{

int n;

FILE *FP;

Fp=fopen ("Data", "r+");

for (n=0;n<100;n++)

Fwrite (&stu[n],sizeof (struct student), 1,FP);

Fwrite (&STUNUM,4,1,FP);

Fclose (FP);

printf ("Save successfully!") Press Enter to continue. ");

Getch ();

}

10 Exit Module

Case ' 8 ': ma=0;break;

Using the jump out while statement

Back to the security module

11 Sorting modules

By bubbling the sorting method

for (m=0;m<y-1;m++)

for (x=m+1;x<y;x++)

if (stu[m].sum<stu[x].sum)

{

STU[99]=STU[M];

STU[M]=STU[X];

STU[X]=STU[99];

Stu[99].id=stu[x].id;

Stu[x].id =stu[m].id;

Stu[m].id =stu[99].id;

}

printf ("Sorted in order: \ n");

Then display the information of the students after sorting;

The basic information structure of students is

struct student

{

int id;

Char name[30];

int age;

Char sex[6];

Char birthday[12];

Char add[80];

Char tel[15];

Char email[25];

int math;

int 中文版;

int sum;

}STU[100]

Four Program Testing

1 Safety Module

Enter this system by entering the correct user name

2 Menu Display

Enter the system and then come to the menu interface by selecting into different modules

3 input function;

Enter the input module by selecting Menu 1 below is the input information interface

4 Browse Modules

If you choose 2 you can go to the Browse module including the basic information in the student's class

5 Modifying the module

Modify the module can be modified by selecting the name, age, gender and other information respectively

Modified Information

6 Sorting modules

Sort from large to small by the size of the total score

Before the sort

After the sort

7 Deleting a module

11 Exit Module

Back to the security module

Five Experimental Conclusion

Through this course design, I basically to make a relatively complete program has a certain understanding and understanding. This week more production, not only the knowledge of C language has a certain consolidation, but also increased our ability to do the hands.

The Student information management system, which relates to the knowledge of structure, chain list, document and circulation, has deepened and consolidated in particular. This includes the assignment of the struct, which is written to the file. Assigns a value from the file to the struct.

Wait a minute.

It is also possible to make initial error correction by the error message that occurs at compile time.

Complete the general steps of a program for design, entry, compilation, if error, then modify, and then

Recompile, compile successfully, see if the result is correct, and repeat the above steps if the result is incorrect.

In the process of compiling the program, I learned the professional skills required for programming, more understanding of the compilation

The attention and patience required by the program.

six GitHub address link : https://github.com/daishimin/test/tree/master

Student management System--object-oriented programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.