Home > Article > Computer Tutorials > Designing a statistical system for students' comprehensive quality scores
1. Follow the following prompts to complete the entry of multiple students’ comprehensive quality scores;
2. Complete the effective storage of each record;
3. Rank and number according to "comprehensive quality";
4. Realize the overall display function of the comprehensive quality score sheet.
Improvement requirements:
1. Implement score query or ranking query;
2. Implement the grade modification function.
The result is:
1. The program can run correctly and there should be clear operation prompts at the beginning;
2. There are corresponding operation key settings, such as A for input, B for storage, C for exit, etc.;
3. It is best to adopt a modular design for the program to facilitate reading and modification.
1. Student Comprehensive Quality Score Table
*** College *** Major *** Class Total *** people
Serial number Student number Name Ideological and moral quality Scientific and cultural quality Physical and mental quality Comprehensive quality Performance ranking
Question supplement: 1. If a friend’s answer satisfies me, I will add another 10 points, thank you, ~
2, because this program is relatively common, if experienced friends have ready-made ones, please share them. I am not asking everyone to rewrite it~
3. Friends who are talking about money should not post this~
#include
#define N 2
#define M 2
int s[N]={0},a[N][M];
char b[N][10];
void fun1(int a[N][M])
{
int i,j;
for(i=0;i { for(j=0;j s[i] =a[i][j]; printf ("The average score of the %dth student is %.2f\n",i 1,s[i]/5.0); } } void fun2(int a[N][M]) { float p[M]={0}; int i,j; for(i=0;i { for(j=0;j p[i] =a[j][i]; p[i]/=10.0; printf ("The average score of the %d course is %.2f\n",i 1,p[i]); } } void fun3(char b[N][10]) { int max,t,i; max=s[0]; for(i=1;i if(s[i]>max) { max=s[i]; t=i; /*Remember the maximum value of i in order to find the name*/ } printf("%s won the highest score %d points among all students\n",b[t],max); } main() { int i,j; float p[M]={0}; /* Enter name and grades*/ for(i=0;i { printf("Enter the name of the %d student:",i 1); scanf("%s",&b[i]); for(j=0;j { printf ("Enter the student's %d score:", j 1); scanf("%d",&a[i][j]); } } printf("\n"); /*Calculate the average score of each student*/ fun1(a); printf("\n"); /*Calculate the average score of each course*/ fun2(a); printf("\n"); /*Compare the maximum total score and the output name*/ fun3(b); return 0; } The code has been tested and runs successfully If you don’t understand anything, please ask me
The above is the detailed content of Designing a statistical system for students' comprehensive quality scores. For more information, please follow other related articles on the PHP Chinese website!