c语言大作业教学管理系统Word文件下载.docx
- 文档编号:19745406
- 上传时间:2023-01-09
- 格式:DOCX
- 页数:9
- 大小:176.97KB
c语言大作业教学管理系统Word文件下载.docx
《c语言大作业教学管理系统Word文件下载.docx》由会员分享,可在线阅读,更多相关《c语言大作业教学管理系统Word文件下载.docx(9页珍藏版)》请在冰豆网上搜索。
(1)自定义函数;
(2)选择结构;
(3)循环结构;
(4)指针的定义与引用;
(5)结构体类型的定义与使用
流程设计:
代码设计:
#include<
stdio.h>
stdlib.h>
string.h>
#defineMaxsize100//最大范围
structstudent_info{
charname[10];
//姓名
intnumber;
//学号
intid;
//身份证号
intbirth;
//出生日期
charaddress[50];
//家庭住址
intscore;
//总成绩
}student[100];
voidInsert(int*count);
/*录入学生信息*///函数定义
voidsearch(intcount);
/*查询学生信息*/
voidUpdate(intcount);
/*修改学生信息*/
voidDelete(int*count);
/*删除学生信息*/
voidshow(intcount);
/*显示学生信息*/
intmain()
{
inti,count=0;
//作为计数器显示已记录的个数
do//显示一个简易菜单
{
printf("
\t\t*******程序功能*********\n\n"
);
\t1.录入学生信息\n"
\t2.查询学生信息\n"
\t3.修改学生信息\n"
\t4.删除学生信息\n"
\t5.显示学生信息\n"
\t6.退出程序\n"
请选择(1—6):
"
scanf("
%d"
&
i);
switch(i)//switch选择结构
{
case1:
Insert(&
count);
break;
case2:
search(count);
case3:
Update(count);
case4:
Delete(&
case5:
show(count);
case6:
break;
default:
printf("
输入错误请重新选择"
break;
}
}while(i!
=6);
//while循环
return0;
}
voidInsert(int*count)//指针//录入学生信息
inti,in_number;
if(*count==Maxsize)//选择
{
对不起人数已满不能再添加"
return;
printf("
请输入学号:
scanf("
in_number);
for(i=0;
i<
*count;
i++)//循环结构
if(student[i].number==in_number)
printf("
已有相同的学号"
}
student[i].number=in_number;
输入一个学生的姓名:
\n"
%s"
student[i].name);
输入一个学生的学号:
student[i].number);
输入一个学生的身份证号:
student[i].id);
输入出生日期:
年-月-日\n"
student[i].birth);
输入一个学生的家庭地址:
\n"
student[i].address);
输入总成绩:
student[i].score);
(*count)++;
voidsearch(intcount)//查询学生信息
inti,number,flag=1;
//标记变量
请输入要查询的编号"
number);
count;
i++)
if(student[i].number==number)//检索输出
学生信息如下:
姓名:
%s\n"
学号:
%d\n"
student[i].number);
身份证号:
student[i].id);
出生日期:
student[i].birth);
家庭住址:
总分:
student[i].score);
flag=0;
//标记值变反
return;
else
该学生不存在!
\n\n"
voidUpdate(intcount)//修改学生信息
输入要修改的学生学号:
i++)//for循环
if(student[i].number==number)
总成绩:
return;
%s没有可修改的数据"
voidDelete(int*count)//删除学生信息
inti,j,number,flag=1;
输入要删除的学生学号:
*count&
&
flag;
if(student[i].number==number)
for(j=i;
j<
*count-1;
j++)
student[j]=student[j+1];
(*count)--;
else
该学生不存在\n\n"
voidshow(intcount)//显示学生信息
inti;
姓名学号身份证号出生日期家庭住址总成绩\n"
%10s"
%10d"
运行结果:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- c语言大作业 教学管理系统 语言 作业 教学管理 系统