In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how to use C language to realize the employee salary management system". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use C language to realize the employee wage management system" can help you solve your doubts. Let's follow the editor's train of thought to slowly deepen, together to learn new knowledge.
Design requirements:
Simulate and design an employee wage management system of an enterprise, the employee information includes job number, name, basic salary and allowance, set the number of employees not more than 500, and complete the corresponding functions by the way of menu options. the main functional requirements are as follows:
1. Establish a payroll
2. Tax deduction and actual payment of wages
3. Display the wage schedule according to the order of actual wages from high to low.
4. Modify the salary information of employees
5. Inquire the salary information of the staff and workers by the job number
6. statistical analysis of staff and workers' wages
7. Exit the system.
Basic ideas:
The employee information input function, data processing and file function of the employee wage management system, the function of finding employee wage information according to the employee's work number, and the function of modifying employee information are divided into several modules, in order to make the program more readable, the program will be written in the form of a function to encapsulate each function, and then read the instructions entered by the user in a loop in the main function. Select different function entry addresses according to the user's instructions, so as to perform different operations and achieve the various functions of the staff and workers' salary management system required by the design.
All codes: # include # define Q 15 / / maximum string length # define N 500 / / maximum number of employees typedef struct workers {int workersID; / / employee number char name [Q]; / / employee name double basicsalary; / / basic salary double allowance; / / allowance double taxsalary / / tax deduction double truesalary; / / actual payroll} WORKERS; / / employee information void Menu (int * n); / / main menu void Payroll (WORKERS work [], int * p); / / establish payroll void Taxsalary (WORKERS work [], int num) / calculate employee tax deduction and actual salary void Sort (WORKERS work [], int num); / / sort wages from high to low void Change (WORKERS work [], int num); / / modify employee wage information int Find (WORKERS work [], int num); / / query employee wage information void Analyse by job number (WORKERS work [], int num) / / wage statistical analysis void Printworkroll (WORKERS work [], int num); / display wage schedule void Writefile (WORKERS work [], int num); / / output data and write to data.txt file int main () {WORKERS work [N]; / / define a structure array to store employee information char ch / / ch to check whether to return the main menu int n _ numm _ 0ret; / / n is the Operand, num is the total number, ret judgement number while (1) {system ("cls"); Menu (& n) / / main menu switch (n) {case 0: system ("cls"); / / exit program printf ("exit successful! \ n "); exit (0); case 1: Payroll (work,&num); / / Establishment of payroll break; case 2: Taxsalary (work,num); / / employee tax deduction and payroll Writefile (work,num) / / output the data and write it to the data.txt file printf ("calculation is complete, and output the data to the txt file! \ n "); Sleep (2000); system (" cls "); break; case 3: Sort (work,num); / / sort wages from highest to lowest Printworkroll (work,num) / / display the salary schedule printf ("\ nreturn to the main menu?" Y or N\ n "); fflush (stdin); ch=getchar (); if (ch=='N') {exit (0);} break; case 4: Change (work,num) / / modify the employee's salary information printf ("\ n return to the main menu?" Y or N\ n "); fflush (stdin); ch=getchar (); if (ch=='N') {exit (0);} break; case 5: ret=Find (work,num) / / query employee salary information by work number if (ret==0) {printf ("check no such person!") / / feedback cannot find information} printf ("\ nDo you want to return to the main menu?" Y or N\ n "); fflush (stdin); ch=getchar (); if (ch=='N') {exit (0);} break; case 6: Analyse (work,num) / / Statistical Analysis of employee wages printf ("\ nDo you want to return to the main menu?" Y or N\ n "); fflush (stdin); ch=getchar (); if (ch=='N') {exit (0);} break;}} return 0 } void Menu (int * n) / / main menu * n is the return Operand {int a; printf ("- employee wage management system -\ n"); printf ("| 1. Set up employee payroll table |\ n "); printf (" | 2. Employee tax deduction and actual salary |\ n "); printf (" | 3. The actual salary is sorted from high to low |\ n "); printf (" | 4. Modify employee salary information |\ n "); printf (" | 5. Query employee salary information |\ n "); printf (" | 6. Statistical analysis of employees' wages |\ n "); printf (" | 0. Exit the system |\ n "); printf (" -\ n "); printf (" hint: please enter a numeric sequence number to select the corresponding operation! \ n "); scanf ("% d ", & a); * void Payroll; system (" cls ");} void Payroll (WORKERS work [], int * p) / / create payroll {int num=*p; char ch; do {system (" cls "); printf (" employee (% d) information\ n ", num+1); printf (" Job number: ") Scanf ("% d", & worknum .workersID); printf ("name:"); scanf ("% s", & worknum] .name); printf ("base salary:"); scanf ("% lf", & worknum .basic salary); printf ("allowance:"); scanf ("% lf", & worknum .allowance) Printf ("do you want to continue typing? Y or N\ n "); fflush (stdin); scanf ("% c ", & ch); num++;} while (ch=='Y'); * system numb; / / return the total number of system (" cls ");} void Taxsalary (WORKERS work [], int num) / / employee tax deduction and paid wages {int i; double money; for
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un