c程序设计报告怎么写( 四 )


二、系统主模块结构图: 详细设计 一、界面设计 此系统界面采用图形和数字化菜单设计 。主界面设计如下: 学生成绩管理系统 请选择相应的数字执行相应的功能: 1:是否输入其他数据 2:查看数据 3:插入数据 4:查找数据 5:更新数据 6:保留数据 7:显示或打印数据 8:语文成绩状况 9:数学成绩状况 10:英语成绩状况 11:计算机成绩状况 12:? 13:退出系统 二、数据结构设计: 程序设计中用到的结构体类型: 学生信息结构体类型: typedef struct student{ char name[MAX]; int num[MAX]; char sex[MAX]; int chinese; int mathematic; int english; int computer; struct student *next; } 程序代码: //原始密码是123456 #include"stdio.h" #include"stddef.h" #include"stddef.h" #include"string.h" #define MAX 10 typedef struct student{ /*定义结构体*/ char name[MAX]; /*姓名*/ int num[MAX]; /* 学号*/ char sex[MAX]; /*性别*/ int chinese; /*语文*/ int mathematic; /* 数学*/ int english; /*英语*/ int computer; /*计算机*/ struct student *next; /*结构体指针*/ }stu; stu *head; /*头指针*/ void print() /*显示或打印函数*/ { system("cls"); printf("\t\t\tScore Manage System\n"); /*成绩管理系统*/ printf("<1>Enter Record\t"); /*输入数据*/ printf("<2>Display\t"); /*显示*/ printf("<3>Insert\t"); /*插入数据*/ printf("<4>Quest\t"); /*访问数据*/ printf("<5>Update\t"); /*以前数据*/ printf("<6>Save\t"); /*保留数据*/ printf("<7>Fresh\t"); /*更新数据*/ printf("<8>Chinese Average\t"); /*语文平均成绩*/ printf("<9>Math Average\t"); /*数学平均成绩*/ printf("<10>English Average\t"); /*英语平均成绩*/ printf("<11>Computer Average\t"); /*计算机平均成绩*/ printf("<12>Quit\t\n"); /*退出*/ } void cin(stu *p1) /*输入相关数据的函数*/ { printf("Enter name:\n"); scanf("%s",&p1->name); printf("Enter num:\n"); scanf("%d",&p1->num); printf("Enter sex:\n"); scanf("%s",&p1->sex); printf("Enter score:\n"); printf("Enter chinese:\n"); scanf("%d",&p1->chinese); printf("Enter math:\n"); scanf("%d",&p1->mathematic); printf("Enter English:\n"); scanf("%d",&p1->english); printf("Enter Computer:\n"); scanf("%d",&p1->computer); } stu *cindata() /*其他数据是否继续输入的函数*/ { stu *p1,*p2; int i=1; char ch; p1=(stu *)malloc(sizeof(stu)); head=p1; while(i) { cin(p1); printf("Do you Want to Continue?yes or no"); /*是否继续输入数据*/ ch=getchar(); ch=getchar(); if(ch=='n'||ch=='N') { i=0; p1->next=NULL; } else { p2=p1; p1=(stu *)malloc(sizeof(stu)); p2->next=p1; } } return(p1->next); } stu *lookdata(stu *p1) /*查看数据的函数*/ { while(p1!=NULL) { printf("Num:%d\t",p1->num); printf("Name:%s\t",p1->name); printf("Sex:%s\t",p1->sex); printf("\n"); printf("Chinese:%d\t",p1->chinese); printf("Math:%d\t",p1->mathematic); printf("English:%d\t",p1->english); printf("Computer:%d\t",p1->computer); printf("\n"); p1=p1->next; } return p1; } void insert() /*通过比较学号来插入数据的函数*/ { stu *p1,*p3,*p2; char ch; p1=head; p3=(stu *)malloc(sizeof(stu)); p3->next=NULL; if(head==NULL){。

c程序设计报告怎么写

文章插图