Home > Back-end >  Student achievement management system (c)
Student achievement management system (c)

Time:11-29

[I] to do a student achievement management system
Student achievement has Chinese maths English
Function: entry record to find the most educational total score lowest points to calculate average




#include
#include
#include


//define the structure of a student
Struct Student {


Double yuwen;
Double shuxue;
Double yingyu.
Struct Student * next;
};
Struct Class {
Struct Student * min;
Struct Class * next;


};
//global variable convenient use
Double ymax=0;
Double ymin=99;
Double smax=0;
Double smin=99;
Double ywmax=0;
Double ywmin=99;
Double sum1=0;
Double sum2=0;
Double sum3=0;
Struct Class * wen=NULL;
Struct Class * hand=NULL;
Struct Student * stuHead=NULL;//used to the new information of class
Struct Class * newData=https://bbs.csdn.net/topics/NULL;//used to the new information of class


Struct Student * chengjishuyu (int stunum)
{
int i;
Int p;
int sum;
Float avg.
Struct Student * new2;
Struct Student * new3;
Struct Student * head;

Printf (" \ n \ n please enter each class then discipline corresponding result \ n ");
For (p=1; p<=5; P++) {
New2=(struct Student *) malloc (sizeof (struct Student));
New3=new2;

Printf (" input the first % d % d class students English \ n ", stunum, p);
Lf the scanf (" % ", & amp; (new2 - & gt; Yingyu));

If (new2 - & gt; Yingyu & lt; 0 | | new2 - & gt; Yingyu & gt; 100)
{
Printf (" input your record is wrong, please input again! \n");
Lf the scanf (" % ", & amp; (new2 - & gt; Yingyu));

}

Printf (" input the first % d % d class student's mathematics result \ n ", stunum, p);
Lf the scanf (" % ", & amp; (new2 - & gt; Shuxue));
If (new2 - & gt; Shuxue & lt; 0 | | new2 - & gt; Shuxue & gt; 100)
{
Printf (" input your record is wrong, please input again! \n");
Lf the scanf (" % ", & amp; (new2 - & gt; Shuxue));

}

Printf (" input the first % d % d class students language result \ n ", stunum, p);
Lf the scanf (" % ", & amp; (new2 - & gt; Yuwen));
If (new2 - & gt; Yuwen & lt; 0 | | new2 - & gt; Yuwen & gt; 100)
{
Printf (" input your record is wrong, please input again! \n");
Lf the scanf (" % ", & amp; (new2 - & gt; Yuwen));

}

If (head==NULL) {
New3=head;
The head=new2;
New2=new2 - & gt; Next;

} else {

The head - & gt; Next=new2;
New2=new2 - & gt; Next;
}

Sum1 +=new3 - & gt; Yuwen;//accumulative save everyone's language result to the global variable
for(int j=1; j<=5; J++)//judge the size of each input language result, and save to the global variable
{
for(int i=1; i<=5; I++) {
If (ywmax & lt; New3 - & gt; Yuwen)
{
Ywmax=new3 - & gt; Yuwen;
} else if (ywmin & gt; New3 - & gt; Yuwen) {

Ywmin=new3 - & gt; Yuwen;
}



}

}


Sum2 +=new3 - & gt; Yingyu.//accumulative save everyone's English to the global variable
for(int j=1; j<=5; J++)//judge the size of the each input record in English, and save to the global variable
{
for(int i=1; i<=5; I++) {
If (ymax & lt; New3 - & gt; Yingyu)
{
Ymax=new3 - & gt; Yingyu.
} else if (ymin & gt; New3 - & gt; Yingyu) {

Ymin=new3 - & gt; Yingyu.
}



}

}
Sum3 +=new3 - & gt; Shuxue;//accumulative save everyone's mathematics result to global variable
for(int j=1; j<=5; J++)//judge the size of the math scores of each input, and saved to the global variable
{
for(int i=1; i<=5; I++) {
If (smax & lt; New3 - & gt; Shuxue)
{
Smax=new3 - & gt; Shuxue;
} else if (smin & gt; New3 - & gt; Shuxue) {

Smin=new3 - & gt; Shuxue;
}



}

}


}


for(int i=1; i<=5; I++) {

Printf (" * * *, "new3 - & gt; Shuxue);



}


Return new3;
}



Struct Class * banjixinxi (struct Class * head)
{


int j;
for(j=1; j<=5; J++)
{
StuHead=chengjishuyu (j);

}


return head;
}





Int main ()
{

Struct Class * han;
Struct Class * head;
Double ypin;
Double ywpin;
Double spin;
While (1) {
The head=banjixinxi (head);
Ywpin=sum1/25;
Ypin=sum2/25;
Spin=sum3/25;
Printf (" \ n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");
Printf (" do you want to find English is % lf the highest, lowest points % lf, average % lf \ n ", ymax, ymin, ypin);
Printf (" lf you want to find the language points is %, % lf the lowest points, average % lf \ n ", ywmax, ywmin, ywpin);
Printf (" do you want to find the math is the highest % lf, % lf the lowest points, average [img=https://img-
Printf (" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");

}



return 0;
}

CodePudding user response:

What's the problem? Or a simple code?

CodePudding user response:

Your code is not complete, such as:
 struct Class * banjixinxi (struct Class * head) 
{

int j;
for(j=1; j<=5; J++)
{
StuHead=chengjishuyu (j);

}
return head;
}

The head here doing nothing, return directly, except for some compilation errors in the program, is the code haven't finished writing, even if it were not for the error can not run, suggest the building finished ask
  • Related