[C&C + + final course design] - employee resource management system (source code + detailed notes) don't miss it.

catalogue

1, Description

2, Function realization

3, Screenshot of operation results

1. System main interface

2. Enter employee information

3. Display all employee information

4. Query by job number

5. Query by educational background

6. Query by salary

7. From large to small according to salary

4, Program source code

5, Other final course design systems

6, Attachment / download address

be careful

Download address of the system

C & C + + final course design

C language final course design

1, Description

         hello everyone! I'm Xiao Xiaozai. I'm approaching the end of the term. Today, I'd like to share with you the C & C + + final course design - employee resource management system. This program is written in C + + & C language, and the running environment is visual C++   6.0, it realizes the employee resource management function: enter employee information, display all employee information, query according to job number, query according to educational background, query according to salary, delete records according to job number, etc. it is a good reference for learning C + + programs. If friends use it to learn or do C + + final course design homework, it must be OK. I'll share it with you!!! If you feel good, remember to give it to the third company!!!

Especially remember: the password entered after running the program is: 123

If you have any questions or comments, please contact me immediately:  

CSDN:Little baby_ CSDN bloghttps://blog.csdn.net/m0_46843484?spm=1000.2115.3001.5343

Copyright notice: unless otherwise stated, the copyright of all articles on this blog belongs to the author. Reprint please indicate the source!

2, Function realization

        1. Enter employee information

        2. Display all employee information

        3. Query by job number

        4. Query by educational background

        5. Query by salary

        6. Delete records according to job number

        7. From large to small according to salary

        8. Save and end

3, Screenshot of operation results

1. System main interface

2. Enter employee information

3. Display all employee information

4. Query by job number

5. Query by educational background

6. Query by salary

7. From large to small according to salary

4, Program source code

  If you establish a good development environment and copy the code directly, you can run it! Pro test valid!!!

/***********************************************************
My message: little boy*
CSDN: https://blog.csdn.net/m0_46843484?spm=1000.2115.3001.5343
***********************************************************/
#include "stdio.h"
#include "stdlib.h"
#include "conio.h"
#include "string.h"

#define N 10
#define FILENAME "zhigong.txt"
typedef struct
{
    int num;         /*Employee number*/
    char n1[10];     /*Employee name*/
	char n2[10];     /*Gender*/
	int nianling;    /*Age*/
	char xueli[20];  /*education*/
    int gongzi;      /*wages*/
    char addr[10];       /*address*/
    int tele;        /*Telephone*/
}GONG;
void displayMenu()
 {

        printf("\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
        printf("+               Employee resource management system                                  +\n");
		printf("+                                                                 +\n");
        printf("+            1. Enter employee information                                      +\n");
        printf("+            2. Display all employee information                                  +\n");
        printf("+            3. Query by job number                                      +\n");
        printf("+            4. Query by educational background                                      +\n");
		printf("+            5. Query by salary                                      +\n");
        printf("+            6. Delete records according to job number                                  +\n");
        printf("+            7. From large to small according to salary                                +\n");
        printf("+            8. Save and end                                        +\n");
		printf("+                                                                 +\n");
        printf("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");

 }
int login(char password[])
 {
     static char key[10]="123";
     if(strcmp(password,key)==0)
       return 1;
     else
       return 0;
  }
int readFromFile(GONG gong[])
 {
	FILE *fp=NULL;
	int i=0;

	fp=fopen(FILENAME,"rb"); 

	if(fp!=NULL)
	{

		while(!feof(fp))   
		{
     
			if(i>=N)
				break;
			if(fread(gong+i,sizeof(GONG),1,fp))
				i++;
		}

		fclose(fp);
	}
    return i;
}
int unique(GONG gong[],int length,int JN)
{
	int flag=1,i;
	for(i=0;i<length;i++)
	{
		if(gong[i].num==JN)
		{ 
			flag=0;
			break;
		}
	}
return flag;
}
/*Enter employee information record*/
int inputInfo(GONG gong[],int length)
{
	int i=length;
	int endFlag=0;
	printf("Please enter employee information (end with number 0):\n");
	while(i<N)
	{
		while(1)
		{
			int flag;
			printf("Employee No.:");
			scanf("%d",&gong[i].num);
			if(gong[i].num==0)
			{
				endFlag=1;
				break;
			}
			flag=unique(gong,i,gong[i].num);
			if(flag) break;
			printf("This employee already exists, please re-enter!\n");
		}
		if(endFlag==1)
			break;
		printf("Employee name:");
		scanf("%s",gong[i].n1);
		printf("Gender:");
		scanf("%s",gong[i].n2);
		while(1)
		{
			printf("Age:");
			if(scanf("%d",&gong[i].nianling)==1)
				break;
			printf("The input format is incorrect, please re-enter!\n");
			while(getchar()!='\n')
				continue;
		}
       	printf("education:");
		scanf("%s",gong[i].xueli);
        while(1)
		{
			printf("Salary:");
			if(scanf("%d",&gong[i].gongzi)==1)
				break;
			printf("The input format is incorrect, please re-enter!\n");
			while(getchar()!='\n')
				continue;
		}
		printf("Address:");
		scanf("%s",gong[i].addr);
		while(1)
		{
			printf("Telephone:");
			if(scanf("%d",&gong[i].tele)==1)
				break;
			printf("The input format is incorrect, please re-enter!\n");
			while(getchar()!='\n')
				continue;
		}

i++;
	
}
return i;
}
/*Display all employee information*/
void outputInfo(GONG gong[],int length)
{
	int i=0;

	printf("%-8s %-8s %-4s %-4s %-4s %-4s %-4s %-4s","Employee number","Employee name","Gender","Age","education","wages","address","Telephone\n\n");
	for(i=0;i<length;i++)
	{
		printf("%-8d %-8s %-4s %-4d %-4s %-4d %-4s %-4d",gong[i].num,gong[i].n1,gong[i].n2,gong[i].nianling,gong[i].xueli,gong[i].gongzi,gong[i].addr,gong[i].tele);
	    printf("\n");
	}
	printf("\n\n");
}
/*Query information according to job number*/
void ghInfo(GONG gong[],int length,int gh)
{
	int i=0;
	for(i=0;i<length;i++)
	{
		if(gh==gong[i].num)
        {
			printf("Found it! His message is:%d\n", i);
		    printf("%-8s %-8s %-4s %-4s %-4s %-4s %-4s %-4s","Employee number","Employee name","Gender","Age","education","wages","address","Telephone\n\n");
		    printf("%-8d %-8s %-4s %-4d %-4s %-4d %-4s %-4d",gong[i].num,gong[i].n1,gong[i].n2,gong[i].nianling,gong[i].xueli,gong[i].gongzi,gong[i].addr,gong[i].tele);
		    break;
        }
    }
    if(i>=length)
    printf("\n non-existent!\n");
}
/*Query information by educational background*/
void xlInfo(GONG gong[],int length,char xl[])
{
	int i=0;
	for(i=0;i<length;i++)
	{
		if(strcmp(xl,gong[i].xueli)==0)
        {
			printf("Found it! His message is:%d\n", i);
		    printf("%-8s %-8s %-4s %-4s %-4s %-4s %-4s %-4s","Employee number","Employee name","Gender","Age","education","wages","address","Telephone\n\n");
		    printf("%-8d %-8s %-4s %-4d %-4s %-4d %-4s %-4d",gong[i].num,gong[i].n1,gong[i].n2,gong[i].nianling,gong[i].xueli,gong[i].gongzi,gong[i].addr,gong[i].tele);
        }
		else
		{printf("\n non-existent!\n");
		}
    }
    
}
/*Query information according to salary*/
void gzInfo(GONG gong[],int length,int gz)
{
	int i=0;
	for(i=0;i<length;i++)
	{
		if(gz==gong[i].gongzi)
        {
			printf("Found it! His message is:%d\n", i);
		    printf("%-8s %-8s %-4s %-4s %-4s %-4s %-4s %-4s","Employee number","Employee name","Gender","Age","education","wages","address","Telephone\n\n");
		    printf("%-8d %-8s %-4s %-4d %-4s %-4d %-4s %-4d",gong[i].num,gong[i].n1,gong[i].n2,gong[i].nianling,gong[i].xueli,gong[i].gongzi,gong[i].addr,gong[i].tele);
        }
		else
		{printf("\n non-existent!\n");
		}
    }

}
/*Delete records according to job number*/
int shanchu(GONG gong[],int length,int gh)
{
	int i,j=0;
	for(i=0;i<length;i++)
	{
		if(gh==gong[i].num)
		{
			length=length-1;
			for(j=i;j<length;j++)
			{
				gong[j].num=gong[j+1].num;
				strcpy(gong[j].n1,gong[j+1].n1);
		        strcpy(gong[j].n2,gong[j+1].n2);
				gong[j].nianling=gong[j+1].nianling;
				strcpy(gong[j].xueli,gong[j+1].xueli);
				gong[j].gongzi=gong[j+1].gongzi;
				strcpy(gong[j].addr,gong[j+1].addr);
				gong[j].tele=gong[j+1].tele;				
			}
			i--;
		}
	}
	return length;
}

/*Sort according to salary from big to small*/
void sortScore(GONG gong[],int length)
{
	int i=0,j=0,k=0;
	GONG s;
	for(i=0;i<length;i++)
	{
		k=i;
		for(j=i+1;j<length;j++)
			if(gong[j].gongzi>gong[k].gongzi)
				k=j;
        s=gong[k];
        gong[k]=gong[i];
        gong[i]=s;
	}
    printf("%-8s %-8s %-4s %-4s %-4s %-4s %-4s %-4s","Employee number","Employee name","Gender","Age","education","wages","address","Telephone\n\n");
	for(i=0;i<length;i++)
	{
		printf("%-8d %-8s %-4s %-4d %-4s %-4d %-4s %-4d",gong[i].num,gong[i].n1,gong[i].n2,gong[i].nianling,gong[i].xueli,gong[i].gongzi,gong[i].addr,gong[i].tele);
	    printf("\n");
	}
	printf("\n\n");
}
void writeToFile(GONG gong[],int length)
{
	FILE *fp=NULL;
	int i=0;

	fp=fopen(FILENAME,"wb");

	if(fp==NULL)
	{
		printf("Error opening file!\n");
		exit(0);
	}

	for(i=0;i<length;i++)
		fwrite(gong+i,sizeof(GONG),1,fp);

	fclose(fp);

}

main()
{
	GONG gong[N];

    int choice = 0;
    int s=0,arrayLength=0,gh,gz;
    char password[10];
    char xl[10];
	

    /*====Verify the user's password until it is correct====*/
	do{
		printf("Please enter the password:");
		scanf("%s",password);

		s=login(password);
     }while(s==0);

	arrayLength=readFromFile(gong);

    /*====Perform corresponding operations according to the user's selection====*/
    while(1)
    {

		displayMenu();

		printf("\n Please select your action(1,2,3,4,5,6,7,8): \n");
        scanf("%d",&choice);

		switch(choice)
        {

			case 1:
				arrayLength=inputInfo(gong,arrayLength);
				printf("\n existing%d Employee information\n",arrayLength);
				break;

			case 2:
				if(arrayLength==0)
				printf("There is no employee information in the system, please initialize first!\n\n");
				else
				outputInfo(gong,arrayLength);
				break;
  
			case 3:
				printf("Please enter the employee number you want to find:\n");
				scanf("%d",&gh);
				ghInfo(gong,arrayLength,gh);
				break;
 
			case 4:
				printf("Please enter the education you want to find:\n");
				scanf("%s",&xl);
				xlInfo(gong,arrayLength,xl);
				break;
            case 5:
				printf("Please enter the salary you want to find:\n");
				scanf("%d",&gz);
				gzInfo(gong,arrayLength,gz);
				break;
            case 6:
				printf("Please enter the employee number to delete:\n");
                scanf("%d",&gh);
				shanchu(gong,arrayLength,gh);
				break;
			case 7:
				sortScore(gong,arrayLength);
				break;
            case 8:
				writeToFile(gong,arrayLength);
				exit(0);
				break;
        }
    }

}

5, Other final course design systems

C & C + + final course design - personal revenue and expenditure management system (I) [source code + detailed notes]_ Xiaotuzi CSDN blog

C & C + + final course design - Product Management System (source code + detailed notes)_ Xiaotuzi CSDN blog

C & C + + final course design -- student performance management source code_ Xiaotuzi CSDN blog

C & C + + final course design -- library management system source code_ Xiaotuzi CSDN blog

C + + final course design - hotel room management system (detailed report + source code + detailed notes) (add "25 +" C + + & & C language final course design system download address)_ Xiaotuzi CSDN blog

6, Attachment / download address

be careful

The download address of "25 +" C + + & & C language final course design (super detailed) is attached below. The introduction of each system introduces the implementation function of the system in detail, and you can find what you need according to the function.

Download address of the system

C/C + + Course Design - employee workload statistics system (source code and notes). zip-C/C + + Document Resources CSDN Library

C & C + + final course design

C & C + + - file grade (source code) - C/C + + Document Resources - CSDN Library

c& c + + Course Design -- library management system.zip_ Library management system c + + add and delete - C/C + + Document Resources - CSDN Library

C & C + + Course Design - student achievement management system. zip-C/C + + Document Resources CSDN Library

C/C + + Course Design - employee workload statistics system (source code and notes). zip-C/C + + Document Resources CSDN Library

C & C + + Course Design - class student file management system source code (source code + comments). zip-C/C + + Document Resources CSDN Library

C & C + + final course design - KTV song management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C& C + + final course design - product information management system (source code + detailed notes) - C/C + + Document Resources - CSDN Library

 C & C + + final course design - personal revenue and expenditure management system (source code + detailed comments) - C/C + + Document Resources - CSDN Library

 C & C + + final course design - employee resource management system (source code + detailed comments) - C/C + + Document Resources - CSDN Library

C & C + + final course design - personal revenue and expenditure management system (II) (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language final course design

C language curriculum design - faculty salary management system (source code + curriculum design + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - score management system source program. zip-C/C + + Document Resources - CSDN Library

C language course design - supermarket management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language course design - train ticket booking management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language course design - commodity sales system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language course design - address book management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - library management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - book borrowing system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - perpetual calendar system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language course design - text editor system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - student achievement management system. zip-C/C + + Document Resources - CSDN Library

 C language curriculum design - student achievement management system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - student information system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

C language curriculum design - drawing board system (source code + detailed notes). zip-C/C + + Document Resources CSDN Library

 -   Copyright notice: unless otherwise stated, the copyright of all articles on this blog belongs to the author. Reprint please indicate the source!

Tags: C C++

Posted on Fri, 26 Nov 2021 10:02:33 -0500 by jmurch