Student Management System

Source: Internet
Author: User
Tags stdin

This system is a freshman curriculum design in the course design made out.

-----------------Completion Time 2013 06 08

  1/Student Management System Completion Time 2013 06 08 2/Freshman First course design 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <str Ing.h> 6 #define N 3 7 #define LEN (student*) malloc (sizeof (Student)) 8/* Student Data structure * * 9 typedef struct NODE 10
 {one char num[20];
 Char name[15];
 int score[n];
 int sum;
 Double Ave;
 struct node *next;
 Student;
 18 19/* Head pointer * Student *head = NULL;
 21/* Temporary pointer * Student *tmp = NULL;
 23/* Course Name/* Char classname[n][30] = {"Big thing", "high number", "C Language"};
 25/* Command switch */num int switch[16] = {0};
 27/* All function declarations/* int Menu ();
 student* Init ();
 int Checknum (char*);
 to int checkname (char*);
 int Cheakscore (int score);
 Same_num Int (char*);
 Inputnodeinfo void (student*);
 (a) void Outputnodeinfo (student*);
 student* Searchfrontnode (student*);
 Panax Notoginseng void Deletenode (student*);
 InsertBefore void ();
 Inputlist ();
 student* Searchid (char*); student* Searchname (char*);
 The void Searchdeletenode ();
 outlist void ();
 The void Searchprintnode ();
 The void Compute ();
 Cmpid Int (student*, student*, int);
 cmpsum Int (student*, student*, int);
 Cmpscore Int (student*, student*, int);
 student* searchmaxnode (int (*cmp) (student*, student*, int), int);
 student* Sort (int (*cmp) (student*, student*, int), int);
 Wu void Outputtofile (file*, student*, int);
 InsertAfter void (student*);
 SaveToFile void ();
 The void LoadFile ();
 A//void CopyFile ();
 void Inserttofile ();
 void Freelist (student* p);
 Stat void ();
 Quit void ();
 60 61/* Main function/+ int main () = int n;   while (1) {n = Menu (); (n = = 1 | | n = 15 | |
 Switch[1]) ({) (n) 73 {74/* Execute initialization * *
 1:76 head = Init ();                         77printf ("Look ....")
 Initialization succeeded \ n ");
 The break;
 79/* Create a linked list, input student information * * Case 2:81 inputlist ();
 a break; 83/* Lookup number or name deletion information * * Case 3:85 Searchdeletenode (
 );
 break;
 87/* Output ALL student information * * 4:89 system ("CLS");
 Outlist ();
 a break;
 92/* Find student information by name * * * case 5:94 searchprintnode ();
 The break;
 96/* Save to File * * 6:98 savetofile ();
The break;     100/* Read student information from File/* Case 7:102 if (Switch[6]) 103                     {head = Init (); LoadFile (); 106 } ' else 108 {109 Print
F ("Current file not saved \ n");
The break;
112/* Calculate total score and average score of all students * * * 113 case 8:114 Compute ();
SWITCH[8] = 1;
116 printf ("Calculated \ n");
117 break;
118/* Insert a student information to the list * * * 119 case 9:120 insertbefore ();
121 Switch[6] = 0;
122 Switch[8] = 0;
123 break;
124//* * Copy File///Case 10:126//CopyFile ();          127 break; Would have wanted to cancel the copy function, there was a problem if the BR was canceled at the same timeEak program will be strange out of the dead loop, not yet resolved 2013 06 13 128/* Sort, sorted by total score and print student information * * 129 case 11:130 
if (Switch[8]) 131 {132 head = Sort (cmpsum, 0);
The System ("CLS");
134 Outlist ();                             135} 136 Else 137 {138
printf ("Please calculate the total score!\n first");
139} 140 break; 141/* Tail Add a student information to the file * * 12:143 Inserttofile
();
144 Switch[6] = 0;
145 printf ("Tail add complete!\n");
146 break; 147/* Search by School number.                             Student Information */148 case 13:149 if (switch[8)) 150 {151 Head = Sort (Cmpid, 0);
152 System ("CLS");
153 Outlist ();                             154} 156 {157
printf ("Please calculate the total score!\n first");
158} 159 break;
160/* Subtotal * * 161 case 14:162 System ("CLS");
163 Stat ();
164 break;
165/* End */166 case 15:167 Quit ();
a break;
169 default:170 printf ("Invalid command number!\n");
171 fflush (stdin);
172} 173 System ("pause"); 174} 175 Else 176 {177 printf ("You must first initialize!\n"); 178 sy
Stem ("pause"); 179} 180} 181} 182       
183 System ("pause");
184 return 0; 185} 186 187/* Menu/188 int menu () 189 {190 int n; 191 system ("CLS"), Fflush (stdin), 193 p
rintf ("*********************************************************************\n");
194 printf ("*********************************************************************\n");
195 printf ("01" initialization ... \ n);
196 printf ("" 02 "input student information \ n");
197 printf ("" "03" Find the school number or name deletion information \ n ");
198 printf ("" 04 "output all student information \ n");
199 printf ("" 05 "find student information by name \ n");
printf ("" 06 "Save to File \ n");
201 printf ("07" reads student information from a file \ n ");
The "08" calculates the total score and average score of all students \ n ");
203 printf ("09" Inserts a student information into the list \ n ");
204//printf ("" 10 "Copy files \ n");
205 printf ("11" sorted by total score and print student information \ n ");
206 printf ("12" tail adds a student information to the file \ n "); 207 printf ("13") Search by study number.
Student information \ n ");
"(" 14 "Subtotal \ n");
209 printf ("" 15 "Exit \ n");
210 printf ("********************************************************************\n"); 211 printf ("Please enter the command series

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.