程序设计基础C综合题 悬赏20分

编写学籍管理系统程序、问题提出:为了分析教学效果并进行相应的学籍处理给工作人员减轻负担、功能要求、循环显示主菜单A菜单输入0-41、录入成绩2、统计成绩3、处理学籍4、创... 编写 学籍管理系统 程序 、 问题提出 : 为了 分析 教学 效果 并进行 相应 的学籍处理 给工作人员减轻负担 、 功能要求、 循环显示 主菜单 A菜单 输入0-4 1、录入成绩 2、统计成绩 3、处理学籍 4、创新功能 0、退出系统 B菜单 输入0-4 1、按学号顺序 2、计算平均分并排序 3、 统计分数段 4、返回 0、退出系统 C菜单 1、生成并打印补考通知单 2、生成并打印退学通知单 3、生成并打印新名册 4、返回 0、退出系统 分不多了 回答给加分 谢谢 展开
 我来答
诗化火相逢3o
2010-04-05 · 超过15用户采纳过TA的回答
知道答主
回答量:63
采纳率:0%
帮助的人:39.1万
展开全部
没有人会为了你的积分给你按要求设计一个的,这个是我做好的,拿来给你用吧,稍微懂点儿的话,改改就能用了,C语言+运行环境TC3.0
#include <stdio.h>
#include <conio.h>
#include <bios.h>
#include <ctype.h>
#include <dos.h>
#include <stdlib.h>
#include <string.h>

#define ESC 0x11B
#define LEFT 0x4B00
#define RIGHT 0x4D00
#define UP 0x4800
#define DOWN 0x5000
#define ENTER 0x1c0d
#define N 100
struct student
{
int flag;
char number[12];
char name[20];
char sex;
int age;
double height;
double weight;
char telephone[12];
char birthday[11];
char XueYuan[50];
char Class[20];
char dormitory[20];
};
struct head
{
char owner[50];
char complete_time[50];
char edition_number[50];
int n;
}head1={"Software research center","2010.4.5","304_1.0",0};
void Init();
void View()
{
gotoxy(1,12);cprintf("number");
gotoxy(9,12);cprintf("name");
gotoxy(15,12);cprintf("sex");
gotoxy(20,12);cprintf("age");
gotoxy(24,12);cprintf("height");
gotoxy(31,12);cprintf("weight");
gotoxy(38,12);cprintf("telephone");
gotoxy(48,12);cprintf("birthday");
gotoxy(57,12);cprintf("XueYuan");
gotoxy(65,12);cprintf("Class");
gotoxy(71,12);cprintf("dormitory");
}
void View2(student du)
{
gotoxy(1,14); cprintf("%s",du.number);
gotoxy(9,14); cprintf("%s",du.name);
gotoxy(15,14); cprintf("%c",du.sex);
gotoxy(20,14); cprintf("%d",du.age);
gotoxy(24,14); cprintf("%.2lf",du.height);
gotoxy(31,14); cprintf("%.1lf",du.weight);
gotoxy(38,14); cprintf("%s",du.telephone);
gotoxy(48,14); cprintf("%s",du.birthday);
gotoxy(57,14); cprintf("%s",du.XueYuan);
gotoxy(65,14); cprintf("%s",du.Class);
gotoxy(71,14); cprintf("%s",du.dormitory);
}
void HELP(FILE *fp)
{
clrscr();
int count=0;
student du;
Init();
textattr(YELLOW);
fseek(fp,sizeof(struct head),0);
while(1)
{
fread(&du,sizeof(struct student),1,fp);

if(feof(fp)!=0)
break;
if(du.flag==1)
count++;
if(du.flag==0)
continue;

}
head1.n=count;
gotoxy(23,25);
cprintf("Owner:%s\n",head1.owner);
gotoxy(23,27);
cprintf("Completed_time:%s\n",head1.complete_time);
gotoxy(23,29);
cprintf("Edition_number:%s\n",head1.edition_number);
gotoxy(23,31);
cprintf("Total number:%d\n",head1.n);
gotoxy(28,33);
cprintf("Press Enter to exit...");
getchar();
}
int ADD(FILE *fp)
{
clrscr();
textattr(WHITE);
rewind(fp);
student xin,du;
gotoxy(10,10);
cprintf("Input a student's information:");
View();

gotoxy(1,14); scanf("%s",&xin.number);getchar();
gotoxy(9,14); scanf("%s",&xin.name);getchar();
gotoxy(15,14); scanf("%c",&xin.sex);getchar();
gotoxy(20,14); scanf("%d",&xin.age);getchar();
gotoxy(24,14); scanf("%lf",&xin.height);getchar();
gotoxy(31,14); scanf("%lf",&xin.weight);getchar();
gotoxy(38,14); scanf("%s",&xin.telephone);getchar();
gotoxy(48,14); scanf("%s",&xin.birthday);getchar();
gotoxy(57,14); scanf("%s",&xin.XueYuan);getchar();
gotoxy(65,14); scanf("%s",&xin.Class);getchar();
gotoxy(71,14); scanf("%s",&xin.dormitory);getchar();
xin.flag=1;
int i=0;
//确定插入位置
fseek(fp,sizeof(struct head),0);

while(1)
{
fread(&du,sizeof(struct student),1,fp);
if(du.flag==0)
break;
if(feof(fp)!=0)
break;
if(strcmp(du.number,xin.number)==0)
{
gotoxy(30,40);
cprintf("The number is existent");
gotoxy(30,42);
cprintf("Strike any key to exit...");
getchar();
return 0;
}
i++;
}
fseek(fp,(sizeof(struct head)+i*sizeof(struct student)),0);
fwrite(&xin,sizeof(struct student),1,fp);
gotoxy(30,40);
cprintf("Added!");
gotoxy(30,42);
cprintf("Strike any key to exit... ");
getchar();
}

void DELETE(FILE *fp)
{
clrscr();
textattr(WHITE);
rewind(fp);
student du;
char xx[20];
gotoxy(10,10);
cprintf("Input the student's number who you want to delete:\n");
gotoxy(10,11);
scanf("%s",xx);
fseek(fp,sizeof(struct head),0);
while(1)
{
fread(&du,sizeof(struct student),1,fp);
if(feof(fp)!=0)
{
gotoxy(30,40);
cprintf("Can't find the number!\n");
getchar();
break;
}
if(du.flag==0)
continue;
if(strcmp(du.number,xx)==0)
{

View();
View2(du);
gotoxy(19,30);
cprintf("Are you ensure to delete this number ?(y/n)\n");
gotoxy(27,31);
getchar();
char c=getchar();
if(c=='y')
{
du.flag=0;
fseek(fp,(ftell(fp)-sizeof(struct student)),0);
fwrite(&du,sizeof(struct student),1,fp);
gotoxy(30,40);
cprintf("Deleted!\n\n");
getchar();
break;
}
else if(c=='n')
break;
else
{
gotoxy(30,40);
printf("Illegle char!");
getchar();
break;
}
}
}
gotoxy(30,42);
cprintf("Strike any key to exit...");
getchar();
}

int CHANGE(FILE *fp)
{
clrscr();
textattr(YELLOW);
rewind(fp);
student xin;
char xx[20];
gotoxy(10,10);
cprintf("Input the student's number who you want to change:\n");
gotoxy(10,11);
scanf("%s",xx);
fseek(fp,sizeof(struct head),0);
while(1)
{
fread(&xin,sizeof(struct student),1,fp);
if(xin.flag==0)
continue;
if(strcmp(xin.number,xx)==0)
{
View();
View2(xin);
gotoxy(19,30);
cprintf("Are you ensure to change this number ?(y/n)\n");
getchar();
char c=getchar();
if(c=='y')
{
fseek(fp,(ftell(fp)-sizeof(struct student)),0);
gotoxy(10,20);
cprintf("Input the new information:");
gotoxy(1,14); scanf("%s",&du.number);getchar();
if(strcmp(du.number,xin.number)==0)
{
gotoxy(30,40);
cprintf("The number is existent");
gotoxy(30,42);
cprintf("Strike any key to exit...");
getchar();
return 0;
}
gotoxy(9,14); scanf("%s",&du.name);getchar();
gotoxy(15,14); scanf("%c",&du.sex);getchar();
gotoxy(20,14); scanf("%d",&du.age);getchar();
gotoxy(24,14); scanf("%lf",&du.height);getchar();
gotoxy(31,14); scanf("%lf",&du.weight);getchar();
gotoxy(38,14); scanf("%s",&du.telephone);getchar();
gotoxy(48,14); scanf("%s",&du.birthday);getchar();
gotoxy(57,14); scanf("%s",&du.XueYuan);getchar();
gotoxy(65,14); scanf("%s",&du.Class);getchar();
gotoxy(71,14); scanf("%s",&du.dormitory);getchar();
fwrite(&du,sizeof(struct student),1,fp);
gotoxy(30,40);
cprintf("Changed!\n\n");
getchar();
break;
}
else if(c=='n')
break;
else
{
gotoxy(30,40);
printf("Illegle char! \n\n");
getchar();
break;
}
}
if(feof(fp)!=0)
{
gotoxy(30,40);
cprintf("Can't find this number!\n\n");
getchar();
break;
}
}
gotoxy(30,42);
cprintf("Strike any key to exit!");
getchar();
}

int display(FILE *fp)
{
textattr(WHITE);
rewind(fp);
student xin;
fseek(fp,sizeof(struct head),0);
int i=1;
View();
while(1)
{
fread(&xin,sizeof(struct student),1,fp);
if(feof(fp)!=0)
{
if(i==1)
{
Init();
gotoxy(20,28);
cprintf("Empty,please add!");
gotoxy(28,33);
cprintf("Press Enter to exit...");
getchar();
return 0;
}
break;
}
if(xin.flag==0)
continue;
gotoxy(10,13+3*i);
gotoxy(1,14+3*i); cprintf("%s",xin.number);
gotoxy(9,14+3*i); cprintf("%s",xin.name);
gotoxy(15,14+3*i); cprintf("%c",xin.sex);
gotoxy(20,14+3*i); cprintf("%d",xin.age);
gotoxy(24,14+3*i); cprintf("%.2lf",xin.height);
gotoxy(31,14+3*i); cprintf("%.1lf",xin.weight);
gotoxy(38,14+3*i); cprintf("%s",xin.telephone);
gotoxy(48,14+3*i); cprintf("%s",xin.birthday);
gotoxy(57,14+3*i); cprintf("%s",xin.XueYuan);
gotoxy(65,14+3*i); cprintf("%s",xin.Class);
gotoxy(71,14+3*i); cprintf("%s",xin.dormitory);
i++;
}
return i;
}
void SEARCH(FILE *fp)
{
clrscr();
textattr(WHITE);
rewind(fp);
student du;
int x;
if(x=display(fp))
{
gotoxy(40,16+3*x);
cprintf("Press any key to see what you want");
getchar();
clrscr();
gotoxy(10,10);
printf("Please input the number: ");
char n[12];
gotoxy(10,11);
scanf("%s",n);
fseek(fp,sizeof(struct head),0);
while(1)
{
fread(&du,sizeof(struct student),1,fp);
if(du.flag==0)
continue;
if(strcmp(du.number,n)==0)
{
View();
View2(du);
break;
}
if(feof(fp)!=0)
{
cprintf("Can't find this number!\n\n");
break;
}
}
gotoxy(28,32);
cprintf("Strike any key to exit...");
getchar();
getchar();
}
}
void Init()
{
clrscr();
textattr(GREEN);
gotoxy(22,15);
cprintf(" 谀哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪目\n");
gotoxy(22,16);
cprintf(" ? WELCOME TO STUDENT SYSTEM 砛n");
gotoxy(22,17);
cprintf(" ? 砛n");
gotoxy(22,18);
cprintf(" ? ZZULI 砛n");
gotoxy(22,19);
cprintf(" 滥哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪馁\n");
gotoxy(18,22);
/* ("433?34?35?36?37?38?39?40?41?42?43?44?45?46?47?48?)
("449?50?51?52?53?54?55?56?57?58?59?60?61?62?63?64?)
("465?66?67?68?69?70?71?72?73?74?75?76?77?78?79?)
*/
cprintf("赏屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯?");
gotoxy(18,23);
cprintf("? ?");
gotoxy(18,24);
cprintf("? ?");
gotoxy(18,25);
cprintf("? ?");
gotoxy(18,26);
cprintf("? ?");
gotoxy(18,27);
cprintf("? ?");
gotoxy(18,28);
cprintf("? ?");
gotoxy(18,29);
cprintf("? ?");
gotoxy(18,30);
cprintf("? ?");
gotoxy(18,31);
cprintf("? ?");
gotoxy(18,32);
cprintf("? ?");
gotoxy(18,33);
cprintf("? ?");
gotoxy(18,34);
cprintf("? ?");
gotoxy(18,35);
cprintf("韧屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯?");

}
void Init2()
{
textattr(WHITE);
gotoxy(37,24);
cprintf("ADD");
gotoxy(36,26);
cprintf("DELETE");
gotoxy(36,28);
cprintf("CHANGE");
gotoxy(36,30);
cprintf("SEARCH");
gotoxy(37,32);
cprintf("HELP");
gotoxy(37,34);
cprintf("EXIT");
}
int main()
{
clrscr();
Init(); Init2();
FILE *fp;
if((fp=fopen("stu_list.dat","rb+"))==NULL)
{
fp=fopen("stu_list.dat","wb+");
}
int ch;
int x,y;
x=37;
y=24;
gotoxy(x,y);
textattr(YELLOW);
cprintf("ADD");
while(1)
{
ch=bioskey(0);
switch(ch)
{
case ENTER:
if(y==24) ADD(fp);
if(y==26) DELETE(fp);
if(y==28) CHANGE(fp);
if(y==30) SEARCH(fp);
if(y==32) HELP(fp);
if(y==34)
{
fclose(fp);
return 0;
}
break;
case ESC:
fclose(fp); return 0;
case DOWN:
if(y<34)
gotoxy(x,y+=2);
break;
case UP:
if(y>24)
gotoxy(x,y-=2) ;
break;
default:
;
}
switch(y)
{
case 24:
Init();Init2();
textattr(YELLOW);
gotoxy(37,24);
cprintf("ADD");
break;
case 26:
Init();Init2();
textattr(YELLOW);
gotoxy(36,26);
cprintf("DELETE");
break;
case 28:
Init();Init2();
textattr(YELLOW);
gotoxy(36,28);
cprintf("CHANGE");
break;
case 30:
Init();Init2();
textattr(YELLOW);
gotoxy(36,30);
cprintf("SEARCH");
break;
case 32:
Init();Init2();
textattr(YELLOW);
gotoxy(37,32);
cprintf("HELP");
break;
case 34:
Init();Init2();
textattr(YELLOW);
gotoxy(37,34);
cprintf("EXIT");
break;
default:
;
}
}
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式