当前位置:网站首页>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 )
边栏推荐
- 证券类开户有什么影响 开户安全吗
- 请求模块(requests)
- Solve the problem of garbled files uploaded by Kirin v10
- json模块
- [summary of knowledge points] chi square distribution, t distribution, F distribution
- [ManageEngine Zhuohao] the role of LAN monitoring
- Tidb database characteristics summary
- XAF Bo of dev XPO comparison
- HDU - 1501 Zipper(记忆化深搜)
- SQL中DML语句(数据操作语言)
猜你喜欢
![[file system] how to run squashfs on UBI](/img/d7/a4769420c510c47f3c2a615b514a8e.png)
[file system] how to run squashfs on UBI

FPGA - clocking -02- clock wiring resources of internal structure of 7 Series FPGA

VS2019如何永久配置本地OpenCV4.5.5使用

IT服务管理(ITSM)在高等教育领域的应用

High order binary search tree

【网络安全工具】USB控制软件有什么用

C语言课设销售管理系统设计(大作业)

C language course set up library information management system (big homework)

【Unity Shader 描边效果_案例分享第一篇】

JDBC database operation
随机推荐
三分钟带你快速了解网站开发的整个流程
Dongle data collection
Make Tiantou village sweet. Is Xianjing taro or cabbage the characteristic agricultural product of Tiantou Village
[ITSM] what is ITSM and why does it department need ITSM
Teach you how to implement a deep learning framework
Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
C语言课设学生选修课程系统(大作业)
异常检测方法梳理,看这篇就够了!
SQL中DML语句(数据操作语言)
高阶-二叉平衡树
How did ManageEngine Zhuohao achieve the goal of being selected into Gartner Magic Quadrant for four consecutive years?
JMM详解
SystemVerilog learning-07-class inheritance and package use
【ManageEngine】终端管理系统,助力华盛证券数字化转型
C语言课设职工信息管理系统(大作业)
[postgraduate entrance examination advanced mathematics Wu Zhongxiang +880 version for personal use] advanced mathematics Chapter II Basic Stage mind map
[ManageEngine] terminal management system helps Huasheng securities' digital transformation
讓田頭村變甜頭村的特色農產品是仙景芋還是白菜
XAF Bo of dev XPO comparison
pycharm 配置jupyter