Teacher salary management system report
catalogue
Teacher salary management system report
1. System requirements and function analysis
5, Operation and commissioning
2. Input the data of the first faculty member
3. Input the data of the second teaching staff
4. Input the data of the third faculty member
5. Input the data of the fourth faculty member
7. Contents of document storage
9, Other final course design systems (open source)
10, Attachment / download address
C language final course design
1, Description
Hello, everyone! I'm Xiao Xiaozai. Today I'd like to share with you the C language final course design - teacher salary management system. This program is written in C language and runs in Visual C + + 6.0. It realizes the functions of teacher salary data entry (inputting various data), statistics (the salary calculation of each executive is finally sorted by salary), printing, backup and so on, It is a good reference for learning C language programs. The system runs in the command line window without visual interface and MFC class library. If friends use it to learn or do C language final course design homework, it must be OK. I'll share it with you!!! If you feel good, remember to give three company!!! Pro test is effective!!!
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, Preface
With the help of modern information technology and management theory, it is imperative to establish school management information system. For schools, it is necessary to fully develop and apply computer management information system. In school management, teachers are not only the valuable resources of the school, but also the "lifeline" of the school. Therefore, personnel management is an important part of the school's computer management information system. Salary management is the top priority of human resource management. The implementation of electronic salary management can free human resource managers from heavy and trivial desk work and complete more important work.
In this course design, my topic is to design the simulation software of "school teacher salary management system". Through the requirements and introduction in the design assignment, it is roughly determined that the main purpose is to learn and master the basic methods and skills of problem analysis, system design, program coding and testing in the software development process.
In order to better complete the curriculum design, I first understood the management structure of school teachers, inquired a large number of books, formulated a reasonable scheme, and then designed the general framework. Next, I slowly expanded each part to make it full, and then completed the general prototype through continuous testing and debugging, Finished the final product.
Finally, through my own efforts and the careful guidance of the instructor, I finally completed the design of this policy software. Through this course design, I basically understood and learned how to analyze and study the characteristics of data objects, data organization methods, and how to select the appropriate data logic structure and storage structure. This is of great help to future study.
3, Abstract
This system can basically meet the needs of school teachers' salary management. Various forms are used in the salary management system to save relevant salary information for convenient query, browsing, modification and other operations. This system combines the actual personnel and financial system, through the actual demand analysis, and uses the powerful VC + + as the development tool to develop the school teacher salary management system.
Firstly, this paper analyzes the application status of school teachers' salary management, and expounds the development purpose of this Teachers' salary management system. Through the analysis of a series of problems, the development platform of the system is determined. Then it gives each link from the analysis of the school teacher salary management system to the overall design, detailed design, implementation and test, and finally summarizes the curriculum design.
The system takes Visual C++ 6.0 as the platform and is written and implemented in C + + programming language, including bubble sorting data structure, basic operation of folders and other basic knowledge. The system can print reports, which is convenient for storage and management.
Key words: object oriented, curriculum design, School of computer science and technology, teacher salary management
4, Detailed design
1. System requirements and function analysis
(1) this is a small college teacher salary management system. The data file of teacher salary management stores the name, monthly salary, teacher number, gender, age and telephone number of teachers. This program can input and display the relevant information of all employees. After entering all the teaching staff, the system will automatically arrange the teaching staff in descending order according to their salaries and save them into the file.
(2) software and hardware environment for project operation:
Windows operating system and corresponding software and hardware
Microsoft Visual C++ 6.0
(3) specific functional requirements of the project:
① data entry: input various data;
② data statistics: the salary calculation of each administrative personnel is finally sorted according to the bubble of salary;
③ data printing: print forms;
④ data backup: write relevant data into files;
(4) class hierarchy diagram
2. Design scheme
First, define the faculty employee; Then the instructor class technician, instructor class manager and professor class seller are derived from the Employee class; In addition, the executive class sellermanager is derived from the lecturer class and the professor class. All kinds of middle-class member functions are just setting and fetching data members. In addition, there are four functions: inputmanager, inputseller, inputsellermanager and inputtechician
Assign values to the objects of four classes: manager, seller, seller and technician. In this system, I use array to operate all teachers. Because this system is designed for small companies, there are 1000 teachers in the system. Start with "employee employee all [EMP];" Statement defines a one-dimensional array used to store employee objects. After the operator completes the input, the system will automatically call a function (compositorall) to arrange the wages of all employees in descending order. Then use the function (outputofile) to automatically save the arranged data in the "D: \ \ computer college teacher salary management system document. txt" file. After saving the data, the system will prompt: "print?", If it is printed, it will be displayed for printing. If it is not printed, it will exit the system directly. On the whole, this program is realized through the call between functions.
3. Data structure table
Data member structure diagram
Serial number | member name | data type | length | Field meaning |
1 | Age | Int | 2 | Age |
2 | Employees | Long | 4 | Total number of faculty |
3 | Monthwages | Double | 4 | Monthly salary of teaching staff |
4 | Name | Char | 10 | full name |
5 | Number | Char | 10 | Faculty number |
6 | Post | Char | 10 | position |
7 | Sex | Char | 10 | Gender |
8 | Telephone | Char | 15 | Telephone number |
9 | Managers | Static int | 2 | Total number of Counselors |
10 | Sellers | Static int | 2 | Total number of professors |
11 | Sellroom | Static double | 4 | Individual course volume |
12 | Sellrooms | Static double | 4 | Total number of courses in the same major |
13 | Technicians | Static int | 2 | Number of lecturers |
4. Data test table
Data test sheet
full name | Little baby | Xiaoqiyuan | Xiao Huang | Xue Mei Zhang | Jiang Haiyan |
position | lecturer | professor | lecturer | professor | professor |
Gender | male | male | male | female | female |
Age | 21 | 39 | 20 | 30 | 21 |
Telephone number | 15974485450 | 09317185886 | 15873697236 | 15886655745 | 15886632946 |
Faculty number | 101 | 102 | 103 | 104 | 105 |
Course quantity | 108 | 109 | 109 | ||
working hours | 101 | 98 | |||
full name | Quan Huan | Qu Huahai | Zhao Xiangji | Dai Saiyu | Zhang Zixuan |
position | instructor | lecturer | lecturer | Administrative staff | professor |
Gender | male | male | male | female | male |
Age | 20 | 21 | 21 | 20 | 21 |
Telephone number | 13875088220 | 15873690339 | 15886643480 | 15886668149 | 15974485474 |
Faculty number | 106 | 107 | 108 | 109 | 110 |
Course quantity | 106 | ||||
working hours | 99 | 97 |
5, Operation and commissioning
1. Main interface
2. Input the data of the first faculty member
3. Input the data of the second teaching staff
4. Input the data of the third faculty member
5. Input the data of the fourth faculty member
6. Print and display data
7. Contents of document storage
6, Problems encountered
Problem 1 and solution
In the following section:
...... ...... int n; cin>>n; switch(n) { case 1: inputtechnician(employeeall[i]); i++; break; case 2: inputmanager(employeeall[i]); i++; break; case 3: inputseller(employeeall[i]); i++; break; case 4: inputsellermanager(employeeall[i]); i++; break; case 5: system("cls");//Refresh screen**** compositorall(employeeall);//The salaries of teaching staff are arranged in descending order outputtofile(employeeall);// Save data to a file* cout<<"Print data( y/n)"; char a[5]; cin>>a; if(a[0]=='y'||a[0]=='Y') printfile();//Display the information in the document on the display return 1; default: cout<<"\t Wrong! Please re-enter!\n"; } ...... ......
If you enter an integer, the program can run normally. If you mistakenly enter a non numeric character (such as a), the program will run here in an "endless loop".
resolvent:
The int variable "n" is defined as a character array char [5]; Then change switch(n) to switch(n[0]) by comparing the first element in the character array. However, if the user enters "145"
In this case, the program compares whether the first character in the character array is "1" or whether the program will run correctly. The solution to this problem is to add a statement if(strlen(n)==1) and else before switch(n[0])
Cout < < "\ terror! Please re-enter! \ n". The modified program segment is as follows:
...... ...... char n[5]; cin>>n; if(strlen(n)==1) { switch(n[0]) { case '1': inputtechnician(employeeall[i]); i++; break; case '2': inputmanager(employeeall[i]); i++; break; case '3': inputseller(employeeall[i]) i++; break; case '4': inputsellermanager(employeeall[i]); i++; break; case '5': system("cls"); //Refresh screen********************** compositorall(employeeall);//The salaries of teaching staff are arranged in descending order outputtofile(employeeall);//Save data to a file* cout<<"Print data( y/n)"; char a[5]; cin>>a; if(a[0]=='y'||a[0]=='Y') printfile();//Display the information in the document on the display return 1; default: cout<<"\t Wrong! Please re-enter!\n"; } } else cout<<"\t Wrong! Please re-enter!\n"; ...... ......
Problem 2 and solution
Improve the correctness of data entry
Solution:
- When entering data, because there is only male and female gender, there can be no other third gender. Therefore, when entering gender, you enter it by selecting rather than typing in gender, so you can effectively avoid the emergence of the third gender.
- A person's name will be within 15 letters in English and 4 Chinese characters, so judge the length of the name by adding a sentence: if (strlen (Temp) > 15. If it does not meet the requirements, re-enter it. If it meets the requirements, continue to run.
When entering the age, the age cannot be a number less than 0 or too large. Judge whether the age is between 18 and 65 through the if (temp < = 18 | temp > 65) statement. Being older than 18 is because the legal age of majority in our country is 18, and you can't work until you reach the age of 18; Less than 65 years old, generally 60 years old is the retirement age and no longer participate in work.
7, Design summary
Object oriented curriculum design is an important professional basic course for computer specialty. The purpose of this course design is based on C language programming language. By completing the compilation, debugging and operation of some difficult course design topics, I can further master the basic methods and programming skills of process-oriented and object-oriented programming, consolidate the theoretical knowledge and combine theory with practice. So as to improve the ability of self analyzing and solving problems. Cultivate independent C language program practice and algorithm design methods, and have preliminary independent analysis and design ability; Basic methods and skills of problem analysis, system design, program coding and testing in software development process; Ability to analyze and solve problems independently by comprehensively using the theoretical knowledge and methods learned.
In general, I learned a lot from this course. The references I found on the Internet are not only useful for this course, but also helpful for future learning, because I learned a lot of practical programming skills.
8, Source code
Note: to save the data file text, you need to establish it in advance and modify the directory of the file in the source program. If you establish a good development environment and copy the code directly, you can run it! Pro test valid!!!
#include<iostream.h> #include<string.h> #include<fstream.h> #include<stdlib.h> /* [[baby] CSDN:https://blog.csdn.net/m0_46843484?spm=1011.2124.3001.5343*/ const int EMP=1000;//Total number of faculty in the College (it can be reduced as needed)************************ void numbertochar(char*,double); //Define the base class faculty class employee****************************************************** class employee{ private: // Name faculty No. position gender Telephone No************************ char name[10],number[10],post[10],sex[10],telephone[15]; int age;//Age************************************************************* double monthwages;//Monthly salary************************************************* static long employees;//Number of faculty*************************************** public: long getemployees() { return employees; } char*getnumber() { return number; } char*getname() { return name; } char*getpost() { return post; } char*getsex() { return sex; } char*gettelephone() { return telephone; } int getage() { return age; } double getmonthwages() { return monthwages; } void setnumber(char temp[]) { renumber: if(strlen(temp)>15) { cout<<"Input error(No more than 15 letters or 5 Chinese characters)!Please re-enter.\n"; char temp1[15]; cout<<"teach work number:\t"; cin>>temp1; if(strlen(temp1)>15) goto renumber; else strcpy(number,temp1); } else strcpy(number,temp); } void setname(char temp[]) { renumber: if(strlen(temp)>15) { cout<<"Input error(No more than 15 letters or 5 Chinese characters)!Please re-enter.\n"; char temp1[10]; cout<<"surname name:\t"; cin>>temp1; if(strlen(temp1)>15) goto renumber; else strcpy(name,temp1); } else strcpy(name,temp); employees++; } void setpost(char temp[]) { renumber: if(strlen(temp)>10) { cout<<"Input error(No more than ten letters or five Chinese characters)!Please re-enter.\n"; char temp1[10]; cout<<"post position\t"; cin>>temp1; if(strlen(temp1)>10) goto renumber; else strcpy(post,temp1); } else strcpy(post,temp); } void setsex() { cout<<"Gender(1,Male; 2. Female):"; resex: char temp1[5]; cin>>temp1; if(strlen(temp1)==1) { switch(temp1[0]) { case '1': strcpy(sex,"male"); break; case '2': strcpy(sex,"female"); break; default: cout<<"Error (please select 1 or 2)"; goto resex; } } else { cout<<"Error (please select 1 or 2)"; goto resex; } } void settelephone(char temp[]) { retelephone: if(strlen(temp)>20) { cout<<"Input error(No more than twenty numbers)!Please re-enter.\n"; char temp1[20]; cout<<"Telephone number:\t"; cin>>temp1; if(strlen(temp1)>20) goto retelephone; else strcpy(telephone,temp1); } else strcpy(telephone,temp); } void setage(int temp) { renumber: if(temp<=18||temp>65) { cout<<"Input error! Please re-enter.\n"; int temp1; cout<<"year age:\t"; cin>>temp1; if(temp1<=0||temp1>120) goto renumber; else age=temp1; } else age=temp; } void setmonthwages(double temp) { monthwages=temp; } }; long employee::employees=0; //Definition of instructor class***************************************************************** class technician: public employee{ protected: static int technicians;//Used to count the number of lecturers******************************** public: int gettechnicians() { return technicians; } void setnumber(char temp[]) { technicians++; employee::setnumber(temp); } void monthly_wages(double temp) { setmonthwages(temp*100); //The lecturer's salary is the course quantity * class hour salary 100 per class hour************************** } }; int technician::technicians=0; //Definition of Counselors*************************************************************** class manager:public employee{ static int managers;//Number of Counselors***************************************** public: int getmanagers() { return managers; } void monthly_wages() { setmonthwages(5000);//The salary of counselors is fixed at 5000 yuan*************************** managers++; } }; int manager::managers=0; //Definition of professor class***************************************************************** class seller:public employee{ protected: static double sellroom; static double sellrooms; static int sellers; public: int getsellers() { return sellers; } double getsellroom() { return sellroom; } double getsellrooms() { return sellrooms; } void setsellroom(double temp) { sellroom=temp; sellrooms=sellrooms+temp; } void monthly_wages() { setmonthwages(sellroom*0.04); sellers++; } }; double seller::sellroom=0; double seller::sellrooms=0; int seller::sellers=0; //Definition of administrative personnel************************************************************* class sellermanager:public seller{ static int sellermanagers;//Number of administrative staff********************************* public: int getsellermanagers() { return sellermanagers; } double getsellrooms() { return sellrooms; } void monthly_wages() { setmonthwages(sellrooms*0.005+5000); sellermanagers++; } }; int sellermanager::sellermanagers=0; //Original function declaration of each data input******************************************************* void inputtechnician(employee&); void inputmanager(employee&); void inputseller(employee&); void inputsellermanager(employee&); void compositorall(employee*);//The salaries of all teaching staff are arranged in descending order*********************** int printfile();//Display the information in the document on the display********************************* void outputtofile(employee*);//Save data to a file****************************** //Main function*********************************************************************** int main() { employee employeeall[EMP]; int i=0; while(i<EMP) { system("cls"); //Refresh screen********************************************** cout<<"*** The system can store"<<EMP<<"Information about a faculty member ***\n"; cout<<" *** Already entered"<<employeeall[0].getemployees() <<"Faculty information ****\n"; cout<<" ********************************\n"; cout<<" *** 1,Input speaking Information of the Division; ***\n"; cout<<" *** 2,Enter the Counselor's information; ***\n"; cout<<" *** 3,Input teaching Information granted; ***\n"; cout<<" *** 4,Enter administrator information; ***\n"; cout<<" *** 5,Exit input! ***\n"; cout<<" ********************************\n"; cout<<"Please select:"; char n[5]; cin>>n; if(strlen(n)==1) { switch(n[0]) { case '1': inputtechnician(employeeall[i]); i++; break; case '2': inputmanager(employeeall[i]); i++; break; case '3': inputseller(employeeall[i]); i++; break; case '4': inputsellermanager(employeeall[i]); i++; break; case '5': system("cls"); //Refresh screen************************************** compositorall(employeeall);//The salaries of all teaching staff are arranged in descending order********** outputtofile(employeeall);//Save data to a file***************** cout<<"Print data( y/n)"; char a[5]; cin>>a; if(a[0]=='y'||a[0]=='Y') printfile();//Display the information in the document on the display***************** return 1; default: cout<<"\t Wrong! Please re-enter!\n"; } } else cout<<"\t Wrong! Please re-enter!\n"; } compositorall(employeeall);//The salaries of all teaching staff are arranged in descending order********************** outputtofile(employeeall);//Save data to a file***************************** printfile();//Display the information in the document on the display********************************* return 0; } //Input function of basic information of teaching staff******************************************************* void inputtechnician(employee &empl) { technician tech; cout<<"\n★★Faculty information:\n"; char temp[20]; cout<<"surname name:\t"; cin>>temp; empl.setname(temp); cout<<"teach work number:\t"; cin>>temp; empl.setnumber(temp); empl.setpost("Lecturer"); empl.setsex(); cout<<"Telephone number:\t"; cin>>temp; empl.settelephone(temp); int tempq=0; cout<<"year age:\t"; cin>>tempq; empl.setage(tempq); double tempp=0; cout<<"working hours(class hour):\t"; cin>>tempp; tech.monthly_wages(tempp); empl.setmonthwages(tech.getmonthwages()); } //Input function of Counselor's basic information*************************************************** void inputmanager(employee &empl) { manager mana; cout<<"\n★★Counselor information:\n"; char temp[20]; cout<<"surname name:\t"; cin>>temp; empl.setname(temp); cout<<"teach work number:\t"; cin>>temp; empl.setnumber(temp); empl.setpost("instructor"); empl.setsex(); cout<<"Telephone number:\t"; cin>>temp; empl.settelephone(temp); int tempq=0; cout<<"year age:\t"; cin>>tempq; empl.setage(tempq); mana.monthly_wages(); empl.setmonthwages(mana.getmonthwages()); } //Input function of basic information taught***************************************************** void inputseller(employee &empl) { seller sell; cout<<"\n★★Professor information:\n"; char temp[20]; cout<<"surname name:\t"; cin>>temp; empl.setname(temp); cout<<"teach work number:\t"; cin>>temp; empl.setnumber(temp); empl.setpost("Professor"); empl.setsex(); cout<<"Telephone number:\t"; cin>>temp; empl.settelephone(temp); int tempq=0; cout<<"year age:\t"; cin>>tempq; empl.setage(tempq); double tempp=0; cout<<"course Course amount:\t"; cin>>tempp; sell.setsellroom(tempp); sell.monthly_wages(); empl.setmonthwages(sell.getmonthwages()); } //Input function of basic information of administrative personnel************************************************* void inputsellermanager(employee &empl) { sellermanager sellmana; cout<<"\n★★Administrative personnel information:\n"; char temp[20]; cout<<"surname name:\t"; cin>>temp; empl.setname(temp); cout<<"teach work number:\t"; cin>>temp; empl.setnumber(temp); empl.setpost("Administrative staff"); empl.setsex(); cout<<"Telephone number:\t"; cin>>temp; empl.settelephone(temp); int tempq=0; cout<<"year age:\t"; cin>>tempq; empl.setage(tempq); sellmana.setsellroom(sellmana.getsellrooms()); sellmana.monthly_wages(); empl.setmonthwages(sellmana.getmonthwages()); } //Save data to a file*********************************************************** void outputtofile(employee *empl) { ofstream fout; fout.open("D:\\Computer college teacher salary management system document.txt"); if(!fout) cout<<"Open file error!"; else { fout<<"full name"<<"\t"; fout<<"Faculty number"<<"\t"; fout<<"post position"<<"\t"; fout<<"Gender"<<"\t"; fout<<"Age"<<"\t"; fout<<"Telephone number"<<"\t\t"; fout<<"Monthly salary"<<"\n"; for(int i=0;i<empl[0].getemployees();i++) { fout<<empl[i].getname()<<"\t"; fout<<empl[i].getnumber()<<"\t"; fout<<empl[i].getpost()<<"\t"; fout<<empl[i].getsex()<<"\t"; fout<<empl[i].getage()<<"\t"; fout<<empl[i].gettelephone()<<"\t"; fout<<empl[i].getmonthwages()<<"\n"; } } } //Display the information in the document on the display************************************************* int printfile() { system("cls"); ifstream fcin; fcin.open("D:\\Computer college teacher salary management system document.txt"); if(!fcin) { cout<<"Failed to open the file. The system will exit automatically!"; return 4; } char ch; while(fcin.get(ch)) { cout<<ch; } fcin.close(); return 0; } //Rank the salaries of all teaching staff in descending order by bubble method********************************************* void compositorall(employee *temp) { employee temp1; for(int j=0;j<temp[0].getemployees();j++) for(int i=temp[0].getemployees()-1;i>j;i--) { if(temp[i].getmonthwages()>temp[i-1].getmonthwages()) { temp1=temp[i]; temp[i]=temp[i-1]; temp[i-1]=temp1; } } }
9, Other final course design systems (open source)
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
10, 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.
C & C + + final course design
C & C + + - file grade (source code) - C/C + + Document Resources - CSDN Library
C language final course design
- copyright notice: unless otherwise stated, the copyright of all articles on this blog belongs to the author. Reprint please indicate the source!