当前位置:网站首页>C language course design student information management system (big homework)
C language course design student information management system (big homework)
2022-07-01 06:26:00 【Ordinary senior】

One 、 Design function ( The article is for reference only )
1) The system works as a menu
2) Student information entry function ( Student information is saved in files )-- Input
3) Student information browsing function -- Output
4) Student information query function -- Algorithm
By student number
Search by name
5) Deletion and modification of student information ( optional )
Two 、 Function display




3、 ... and 、 Mind mapping




Four 、 Program source code
#include <stdio.h>
#include <string.h>
struct student// Structure type name
{
long int num;
char name[20];
int age;
char sex[4];
char b[30];
char p[15];
};
int n=0;
struct student stu[100];
struct student *p;// Point to student A pointer variable in
void lr();
void ll();
void cx();
void xg();
void sc();
int main()
{
int z;
printf("+---------------------------+\n");
printf("| Welcome to the student information management system |\n");
printf("+---------------------------+\n");
printf(" Tips : To ensure that your operation is saved , Please exit the system in the normal order ^_^\n");
do
{
printf("\n\t\t\t--------------------------------\n");
printf("\t\t\t+ The main menu |\n");
printf("\t\t\t--------------------------------\n");
printf("\t\t\t+ [1]---- Enter student information |\n");
printf("\t\t\t+ [2]---- Browse student information |\n");
printf("\t\t\t+ [3]---- Search for student information |\n");
printf("\t\t\t+ [4]---- Delete student information |\n");
printf("\t\t\t+ [5]---- Modify student information |\n");
printf("\t\t\t+ [0]---- Exit the system |\n");
printf("\t\t\t--------------------------------\n");
printf(" Please enter your choice :");
scanf("%d", &z);
switch(z)
{
case 0 : break;
case 1 :lr();break;
case 2 :ll();break;
case 3 :cx();break;
case 4 :sc();break;
case 5 :xg();break;
default:printf("\n invalid option !");
}
}
while(z!= 0);
}
void lr()/* Input function */
{
int y;
if(n==0)
p=stu;
do
{
printf("--------------------\n");
printf(" Please enter the student number :");
scanf("%ld",&p->num);
printf(" Please enter the student's name :");
scanf("%s",p->name);
printf(" Please enter the age of the student :");
scanf("%d",&p->age);
printf(" Please enter the gender of the student :");
scanf("%s",p->sex);
printf(" Please enter the student's address :");
scanf("%s",p->b);
printf(" Please enter the student's phone number :");
scanf("%s",p->p);
n++;
p++;
printf("\n1. Continue to input .\n0. Input complete .\n");
printf(" Please select :");
scanf("%d",&y);
}
while(y==1);
printf(" Tips : Input complete ! You have entered a total of %d individual \n",n);
}
void ll()/* Browse functions */
{
int i,j;
if(n!=0)
{
printf(" Total number of students :%d\n", n);
printf(" Student number \t full name \t Age \t Gender \t Address \t\t Telephone \n");
printf("-----------------------------------------------------\n");
for(i=0;i<n;i++)
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
}
else printf(" Tips : No student data , Please input data !");
}
void cx()/* Query function */
{
int c;
int w,i,j=0;
char name[20];
if(n!=0)
{
do{
printf("\n");
printf("+--------------------+\n");
printf("| By student number Please press 1 |\n");
printf("| Search by name Please press 2 |\n");
printf("| Cancel Please press 0 |\n");
printf("+--------------------+\n");
printf(" Please enter your choice :");
scanf("%d", &c);
switch(c)
{
case 0:break;
case 1:
printf(" Please enter the student number ;");
scanf("%ld", &w);
printf("\n");
for(i=0;i<n;i++)
if(stu[i].num==w)
{
printf("\n Student number \t full name \t Age \t Gender \t Address \t\t Telephone \n");
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
j=1;
}
if(j==0)
printf(" Tips : No student record , Please check !");
break;
case 2:
printf(" Please enter the student's name :");
scanf("%s", name);
printf("\n");
for(i=0;i<n;i++)
if(strcmp(name,stu[i].name)==0)
{
printf("\n Student number \t full name \t Age \t Gender \t Address \t\t Telephone \n");
j=1;
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
}
if(j==0)
printf(" Tips : No student record , Please check !");
break;
default:
printf("\n Tips : invalid option !");
break;
}
}while(c!= 0);
}else printf(" Tips : No student data , Please input data !");
return;
}
void xg()/* Modify the function */
{
long int num;
int i,j,c;
if(n!=0)
{
printf(" Please enter the student number of the student you want to modify :");
scanf("%ld", &num);
printf("\n");
for(i=0;i<n;i++)
if(stu[i].num==num)
j=i;
do{
printf(" Please select the information content of the student you want to modify :\n");
printf("+----------------------+\n");
printf("| full name Please press 1 |\n");
printf("| Age Please press 2 |\n");
printf("| Gender Please press 3 |\n");
printf("| Student number Please press 4 |\n");
printf("| Address Please press 5 |\n");
printf("| Telephone Please press 6 |\n");
printf("| Cancel Please press 0 |\n");
printf("+----------------------+\n");
printf(" Please enter your choice :");
scanf("%d", &c);
printf("\n");
switch(c)
{
case 0:break;
case 1:printf(" Please enter a new name :");
scanf("%s",stu[j].name);
break;
case 2:printf(" Please enter a new age :");
scanf("%d",&stu[j].age);
break;
case 3:printf(" Please enter a new gender :");
scanf("%s",stu[j].sex);
break;
case 4:printf(" Please enter a new student number :");
scanf("%ld",&stu[j].num);
break;
case 5:printf(" Please enter a new address :");
scanf("%s",stu[j].b);
break;
case 6:printf(" Please enter a new phone number :");
scanf("%s",stu[j].p);
break;
default:
printf("\n invalid option !");
break;
}
}while(c!= 0);
}else printf(" Tips : No student data , Please input data !");
}
void sc()/* Delete function */
{
long int num;
int i,j,e;
if(n!=0)
{
printf(" Student number \t full name \t Age \t Gender \t Address \t\t Telephone \n");
printf("-----------------------------------------------------\n");
for(i=0;i<n;i++)
printf("%ld\t%s\t%d\t%s\t%s\t\t%s\n",stu[i].num,stu[i].name,stu[i].age,stu[i].sex,stu[i].b,stu[i].p);
printf(" Please enter the student number of the student you want to delete :");
scanf("%ld", &num);
printf("\n");
for(i=0;i<n;i++)
if(num==stu[i].num)
j=i;
if(j!=(n-1))
{
for(e=i-1;e<n;e++,j++)
{
stu[j].num=stu[j+1].num;
strcpy(stu[j].name,stu[j+1].name);
strcpy(stu[j].sex,stu[j+1].sex);
stu[j].age=stu[j+1].age;
strcpy(stu[j].b,stu[j+1].b);
strcpy(stu[j].p,stu[j+1].p);
n--;p--;
}
}else {
n--;p--;}
printf(" Tips : Delete completed !");
}else printf(" Tips : No student data , Please input data !");
}

You can pay attention to it, and it will be updated continuously in the future 0.0( Thank you first )
边栏推荐
- 【ITSM】什么是ITSM,IT部门为什么需要ITSM
- Minio error correction code, construction and startup of distributed Minio cluster
- 10 golang operator
- Discrimination between left and right limits of derivatives and left and right derivatives
- [leetcode] day91- duplicate elements exist
- 证券类开户有什么影响 开户安全吗
- How does the port scanning tool help enterprises?
- Tidb single machine simulation deployment production environment cluster (closed pit practice, personal test is effective)
- 【ManageEngine】终端管理系统,助力华盛证券数字化转型
- C语言课设物业费管理系统(大作业)
猜你喜欢
随机推荐
Promise
ABP 学习解决方案中的项目以及依赖关系
Tidb single machine simulation deployment production environment cluster (closed pit practice, personal test is effective)
【ManageEngine卓豪】网络运维管理是什么,网络运维平台有什么用
C#如何打印输出原版数组
[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform
C语言课设图书信息管理系统(大作业)
Dongle data collection
【ITSM】什么是ITSM,IT部门为什么需要ITSM
Minio error correction code, construction and startup of distributed Minio cluster
Freeswitch dial the extension number
Transformer le village de tiantou en un village de betteraves sucrières
端口扫描工具是什么?端口扫描工具有什么用
Recueillir des trésors dans le palais souterrain (recherche de mémoire profonde)
【KV260】利用XADC生成芯片温度曲线图
[network security tool] what is the use of USB control software
golang panic recover自定义异常处理
[file system] how to run squashfs on UBI
【#Unity Shader#Amplify Shader Editor(ASE)_第九篇】
JMM详解









