企業工資管理系統課程設計
① c++課程設計某企業職工工資管理系統(跪求)
grass your mom
② 工資管理信息系統課程設計開發背景怎麼寫
我認為中心來應該是:
(在市場經自濟的大環境下,越來越多的人士逐漸認識到用計算機技術進行各類管理,交流的便捷,其中最突出的要算企事業單位的人事工資管理了,為了提高人事工資管理效率,減輕勞動強度,提高信息處理速度和准確性,在對其組成結構和系統功能進行了全面地分析,提出了人事工資管理系統的實現和解決方案,該方案利用計算機支持高效率地完成人事工資管理的日常事務,是適應現代企事業單位制度要求、推動企事業單位人事工資管理走向科學化、規范化的必要條件。)
設計的思路:
應該以Visual Basic6.0為開發語言和ACCESS2000為資料庫以及其他第三方控制項等軟體作為設計工具,以工資為對象,開發的一個能夠滿足企事業單位的工資管理的要求的「人事工資管理系統」。
要求本系統具有完成單位人員工資管理的全過程,包括用戶管理,員工管理,維護不同職務,職稱,其他工資的工資標准以及瀏覽與結算和查詢等。
關鍵詞:工資管理系統; VB; ACCESS
③ 課程設計,工資管理系統完整源代碼
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#define MONTH_NUM 5 /* 最多的月份 */
struct worker
{
int number; /* 每個工人的工號 */
char name[15]; /* 每個工人的姓名 */
int salary[MONTH_NUM]; /* 每個工人M月的工資 */
int sum; /* 每個工人的總工資 */
float average; /* 每個工人的平均工資 */
struct worker *next;
};
typedef struct worker STU;
char Menu(void);
int Ascending(int a, int b);
int Descending(int a, int b);
void IntSwap(int *pt1, int *pt2);
void CharSwap(char *pt1, char *pt2);
void FloatSwap(float *pt1, float *pt2);
STU *AppendNode(STU *head, const int m);
STU *DeleteNode(STU *head, int nodeNum);
STU *ModifyNode(STU *head, int nodeNum, const int m);
STU *SearchNode(STU *head, int nodeNum);
STU *Appendsalary(STU *head, const int m);
void Totalsalary(STU *head, const int m);
void Printsalary(STU *head, const int m);
STU *Deletesalary(STU *head, const int m);
void Modifysalary(STU *head, const int m);
void Sortsalary(STU *head, const int m, int (*compare)(int a, int b));
void Searchsalary(STU *head, const int m);
void DeleteMemory(STU *head);
main()
{
char ch;
int m;
STU *head = NULL;
printf("輸入要記錄的月份(m<10):");
scanf("%d", &m);
while (1)
{
ch = Menu();
switch (ch)
{
case'1':head = Appendsalary(head, m);
Totalsalary(head, m);
break;
case'2':Printsalary(head, m);
break;
case'3':head = Deletesalary(head, m);
printf("\nAfter deleted\n");
Printsalary(head, m);
break;
case'4':Modifysalary(head, m);
Totalsalary(head, m);
printf("\nAfter modified\n");
Printsalary(head, m);
break;
case'5':Searchsalary(head, m);
break;
case'6':Sortsalary(head, m, Descending);
printf("\nsorted in descending order by sum\n");
Printsalary(head, m);
break;
case'7':Sortsalary(head, m, Ascending);
printf("\nsorted in ascending order by sum\n");
Printsalary(head, m);
break;
case'0':exit(0);
DeleteMemory(head);
printf("End of program!");
break;
default:printf("Input error!");
break;
}
}
}
char Menu(void)
{
char ch;
printf("\n管理工人的工資\n");
printf(" 1.添加記錄\n");
printf(" 2.列出記錄\n");
printf(" 3.刪除記錄\n");
printf(" 4.修改記錄\n");
printf(" 5.查找記錄\n");
printf(" 6.降序排列\n");
printf(" 7.升序排列\n");
printf(" 0.退出\n");
printf("請輸入你的選擇:");
scanf(" %c", &ch); /*在%c前面加一個空格,將存於緩沖區中的回車符讀入*/
return ch;
}
STU *Appendsalary(STU *head, const int m)
{
int i = 0;
char c;
do{
head = AppendNode(head, m); /*向鏈表末尾添加一個節點*/
printf("你想添加一個新的記錄嗎(Y/N)?");
scanf(" %c",&c); /*%c前面有一個空格*/
i++;
}while (c=='Y' || c=='y');
printf("%d new nodes have been apended!\n", i);
return head;
}
STU *Deletesalary(STU *head, const int m)
{
int i = 0, nodeNum;
char c;
do{
printf("請輸入你想刪除的記錄編號:");
scanf("%d", &nodeNum);
head = DeleteNode(head, nodeNum); /*刪除工號為nodeNum的工人信息*/
Printsalary(head, m); /*顯示當前鏈表中的各節點信息*/
printf("Do you want to delete a node(Y/N)?");
scanf(" %c",&c); /*%c前面有一個空格*/
i++;
}while (c=='Y' || c=='y');
printf("%d nodes have been deleted!\n", i);
return head;
}
void Modifysalary(STU *head, const int m)
{
int i = 0, nodeNum;
char c;
do{
printf("請輸入你想修改的記錄編號:");
scanf("%d", &nodeNum);
head = ModifyNode(head, nodeNum, m); /*修改工號為nodeNum的節點*/
printf("Do you want to modify a node(Y/N)?");
scanf(" %c",&c); /*%c前面有一個空格*/
i++;
}while (c=='Y' || c=='y');
printf("%d nodes have been modified!\n", i);
}
void Totalsalary(STU *head, const int m)
{
STU *p = head;
int i;
while (p != NULL) /*若不是表尾,則循環*/
{
p->sum = 0;
for (i=0; i<m; i++)
{
p->sum += p->salary[i];
}
p->average = (float)p->sum / m;
p = p->next; /*讓p指向下一個節點*/
}
}
void Sortsalary(STU *head, const int m, int (*compare)(int a, int b))
{
STU *pt;
int flag = 0, i;
do{
flag = 0 ;
pt = head;
/*若後一個節點的總工資比前一個節點的總工資高,則交換兩個節點中的數據
注意只交換節點數據,而節點順序不變,即節點next指針內容不進行交換*/
while (pt->next != NULL)
{
if ((*compare)(pt->next->sum, pt->sum))
{
IntSwap(&pt->number, &pt->next->number);
CharSwap(pt->name, pt->next->name);
for (i=0; i<m; i++)
{
IntSwap(&pt->salary[i], &pt->next->salary[i]);
}
IntSwap(&pt->sum, &pt->next->sum);
FloatSwap(&pt->average, &pt->next->average);
flag = 1;
}
pt = pt->next;
}
}while(flag);
}
/*交換兩個整型數*/
void IntSwap(int *pt1, int *pt2)
{
int temp;
temp = *pt1;
*pt1 = *pt2;
*pt2 = temp;
}
/*交換兩個實型數*/
void FloatSwap(float *pt1, float *pt2)
{
float temp;
temp = *pt1;
*pt1 = *pt2;
*pt2 = temp;
}
/*交換兩個字元串*/
void CharSwap(char *pt1, char *pt2)
{
char temp[15];
strcpy(temp, pt1);
strcpy(pt1, pt2);
strcpy(pt2, temp);
}
/*決定數據是否按升序排序,a<b為真,則按升序排序*/
int Ascending(int a, int b)
{
return a < b;
}
/* 決定數據是否按降序排序,a>b為真,則按降序排序 */
int Descending(int a, int b)
{
return a > b;
}
void Searchsalary(STU *head, const int m)
{
int number, i;
STU *findNode;
printf("請輸入你想查找的記錄編號:");
scanf("%d", &number);
findNode = SearchNode(head, number);
if (findNode == NULL)
{
printf("Not found!\n");
}
else
{
printf("\nNo.%3d%8s", findNode->number, findNode->name);
for (i=0; i<m; i++)
{
printf("%7d", findNode->salary[i]);
}
printf("%9d%9.2f\n", findNode->sum, findNode->average);
}
}
void Printsalary(STU *head, const int m)
{
STU *p = head;
char str[100] = {'\0'}, temp[3];
int i, j = 1;
strcat(str, "Number Name ");
for (i=1; i<=m; i++)
{
strcat(str, "salary");
itoa(i,temp, 10);
strcat(str, temp);
strcat(str, " ");
}
strcat(str," sum average");
printf("%s", str); /* 列印表頭 */
while (p != NULL) /*若不是表尾,則循環列印*/
{
printf("\nNo.%3d%15s", p->number, p->name);
for (i=0; i<m; i++)
{
printf("%7d", p->salary[i]);
}
printf("%9d%9.2f", p->sum, p->average);
p = p->next; /*讓p指向下一個節點*/
j++;
}
printf("\n");
}
STU *AppendNode(STU *head, const int m)
{
STU *p = NULL;
STU *pr = head;
int j;
p = (STU *)malloc(sizeof(STU)); /*為新添加的節點申請內存*/
if (p == NULL) /*若申請內存失敗,則列印錯誤信息,退出程序*/
{
printf("No enough memory to alloc");
exit(0);
}
if (head == NULL) /*若原鏈表為空表,則將新建節點置為首節點*/
{
head = p;
}
else /*若原鏈表為非空,則將新建節點添加到表尾*/
{
/*若未到表尾,則繼續移動指針pr,直到pr指向表尾*/
while (pr->next != NULL)
{
pr = pr->next;
}
pr->next = p; /*將新建節點添加到鏈表的末尾*/
}
pr = p; /*讓pr指向新建節點*/
printf("Input node data......");
printf("\nInput number:");
scanf("%d", &p->number);
printf("Input name:");
scanf("%s", p->name);
for (j=0; j<m; j++)
{
printf("Input salary%d:", j+1);
scanf("%d", p->salary+j);
}
pr->next = NULL; /*將新建節點置為表尾*/
return head; /*返回添加節點後的鏈表的頭節點指針*/
}
STU *ModifyNode(STU *head, int nodeNum, const int m)
{
int j;
STU *newNode;
newNode = SearchNode(head, nodeNum);
if (newNode == NULL)
{
printf("Not found!\n");
}
else
{
printf("Input the new node data:\n");
printf("Input name:");
scanf("%s", newNode->name);
for (j=0; j<m; j++)
{
printf("Input salary%d:", j+1);
scanf("%d", newNode->salary+j);
}
}
return head;
}
STU *DeleteNode(STU *head, int nodeNum)
{
STU *p = head, *pr = head;
if (head == NULL) /*鏈表為空,沒有節點,無法刪除節點*/
{
printf("No Linked Table!\n");
return(head);
}
/*若沒找到節點nodeNum且未到表尾,則繼續找*/
while (nodeNum != p->number && p->next != NULL)
{
pr = p;
p = p->next;
}
if (nodeNum == p->number) /*若找到節點nodeNum,則刪除該節點*/
{
if (p == head) /*若待刪節點為首節點,則讓head指向第2個節點*/
{
head = p->next;
}
else /*若待刪節點非首節點,則將前一節點指針指向當前節點的下一節點*/
{
pr->next = p->next;
}
free(p); /*釋放為已刪除節點分配的內存*/
}
else /*沒有找到待刪除節點*/
{
printf("This Node has not been found!\n");
}
return head; /*返回刪除節點後的鏈表的頭節點指針*/
}
STU *SearchNode(STU *head, int nodeNum)
{
STU *p = head;
int j = 1;
while (p != NULL) /*若不是表尾,則循環*/
{
if (p->number == nodeNum) return p;
p = p->next; /*讓p指向下一個節點*/
j++;
}
return NULL;
}
void DeleteMemory(STU *head)
{
STU *p = head, *pr = NULL;
while (p != NULL) /*若不是表尾,則釋放節點佔用的內存*/
{
pr = p; /*在pr中保存當前節點的指針*/
p = p->next; /*讓p指向下一個節點*/
free(pr); /*釋放pr指向的當前節點佔用的內存*/
}
}
湊合著用吧,一些缺少的功能自己加上去就行了。。。
④ 工資管理系統的設計與實現 一、 課程設計目的 1、 進一步掌握和利用
你好!這個設計要求有點多,程序什麼時間要呢?可以嘗試完成
⑤ C語言課程設計 某企業職工工資管理系統
我這里有一份我當年坐課程設計的程序,你可以改改
# include <iostream>
# include <fstream>
# include <string>
# include <iomanip>
# include <stdlib.h>
using namespace std;
struct worker_inf
{
int month; //月份
int code; //工人編號
string name; //姓名
float get[4]; //基本工資,津貼,房帖,交通補貼
float pay[4]; //房租,儲蓄,交通費,會費
float tax; //個人所得稅
float theory_num; //應發書
float rece_num; //應扣數
float practice_num; //實發數
worker_inf *next;
};
/////////////////////////////////////////////////////////////////
class worker //定義職工類
{
private:
worker_inf *head;
void print(worker_inf *); //輸出一條指定職工的工資記錄,並返回該記錄的指針
worker_inf *find(int); //查找條例條件的記錄,並返回該記錄的指針
public:
worker(){head=NULL;}
worker_inf *get_head(){return head;}
int listcount(); //統計當前鏈表的記錄總數,並返回一個整數
void additem(int month,int code,string name,float get[4],float pay[4]); //添加一條工資記錄表尾
void removeitem(int); //刪除一條指定職工的工資記錄
int menu(); //修改某職工工資的菜單
void changemonth(); //修改月份
void changeitem(int); //修改職工的工資信息
void list(); //輸出當月全體職工的工資信息
void search(int); //輸出指定編號職工的工資信息
float tax_num(); //計算職工個人所得稅
float theorynumber(); //計算應發工資
float recenumber(); //計算應扣工資
float practicenumber(); //計算實發工資
};
//////////////////////////////////////////////////////////////////
int worker::listcount() //統計當前鏈表數,並返回一個整數
{
if(!head)return 0;
worker_inf *p=head;
int n=0;
while(p)
{n++;p=p->next;}
return n;
}
//////////////////////////////////////////////////////////////////
void worker::additem(int month,int code,string name,float get[4],float pay[4]) //添加一條工資記錄到表尾
{
if(!head)
{
head=new worker_inf;
for(int i=0;i<4;i++)
{
head->get[i]=get[i];
head->pay[i]=pay[i];
}
head->code=code;
head->month=month;
head->name=name;
head->next=NULL;
return;
}
worker_inf *t=head;
while(t && t->code!=code)
t=t->next;
if(t)
{
cout<<"操作失敗:編號為"<<code<<"的記錄已經存在!"<<endl;
return;
}
worker_inf *p=head;
while(p->next)p=p->next;
worker_inf *p1=new worker_inf;
p1->code=code;
for(int i=0;i<4;i++)
{
p1->get[i]=get[i];
p1->pay[i]=pay[i];
}
p1->code=code;
p1->month=month;
p1->name=name;
p1->next=NULL;
p->next=p1;
return;
}
////////////////////////////////////////////////////////////////////
void worker::removeitem(int code) //刪除一條指定職工的工資記錄
{
worker_inf *t=find(code);
if(!t)return;
worker_inf *p=head;//如果要刪除的記錄位於表頭
if(head==t)
{
head=head->next;
delete p;
cout<<"成功刪除編號為"<<code<<"的記錄!"<<endl<<endl;
return;
}
while(p->next!=t)p=p->next;
worker_inf *p1=p->next;
p->next=p1->next;
delete p1;
cout<<"成功刪除編號為"<<code<<"的記錄!"<<endl<<endl;
return;
}
////////////////////////////////////////////////////////////////
int worker::menu() //修改某一職工信息的菜單
{
int select=-1;
cout<<"\t\t\t\t\t\t**************修改菜單**************"<<endl<<endl;
cout<<"1.基本工資"<<endl<<endl;
cout<<"2.津貼"<<endl<<endl;
cout<<"3.房帖"<<endl<<endl;
cout<<"4.交通補貼"<<endl<<endl;
cout<<"5.房租"<<endl<<endl;
cout<<"6.儲蓄"<<endl<<endl;
cout<<"7.交通費"<<endl<<endl;
cout<<"8.會費"<<endl<<endl;
cout<<"0.退出修改系統"<<endl<<endl;
cout<<"[請選擇(輸入相應數字)]:";
cin>>select;
if(select<0||select>9)
{
cout<<"對不起您輸入錯誤!請重新輸入【0-9】:"<<endl;
cin>>select;
}
return select;
}
/////////////////////////////////////////////////////////////////
int menu();
void worker::changeitem(int code) //修改某職工部分工資信息
{
worker_inf *p=find(code);
if(!p){cout<<"不存在職工編號為"<<code<<"的職工工資信息"<<endl;return;}
int select;
while(1)
{
float m;
select=menu();
if(select==0){system("cls");break;}
cout<<"請輸入修改後的值";
cin>>m;
int n;
if(select<=4){
n=select-1;
p->get[n]=m;}
else{
n=select-5;
p->pay[n]=m;}
tax_num();
theorynumber();
recenumber();
practicenumber();
cout<<"修改成功"<<endl;
}
}
////////////////////////////////////////////////////////////////////
void worker::changemonth() //修改月份
{
worker_inf *p=head;
while(p)
{
if(p->month==12)p->month=1;
else
p->month++;
p=p->next;
}
}
//////////////////////////////////////////////////////////////////////
void worker::print(worker_inf *p)//輸出worker_inf制定的記錄
{
cout.precision(0);
cout<<p->month<<" ";
cout<<p->code<<" ";
cout<<p->name<<"\t";
for(int i=0;i<4;i++)
{cout<<setiosflags(ios::fixed)<<p->get[i]<<"\t";}
for(int j=0;j<4;j++)
{cout<<p->pay[j]<<"\t";}
cout<<p->tax<<"\t";
cout<<p->theory_num<<"\t";
cout<<p->rece_num<<"\t";
cout<<p->practice_num<<endl<<endl;
return;
}
///////////////////////////////////////////////////////////////////////
void worker::list() //列出當前鏈表中的所有記錄
{
if(listcount==0)
{
cout<<"錯誤:當前的列表為空!"<<endl;
return;
}
worker_inf *p=head;
cout<<"共有記錄:"<<listcount()<<endl;
cout<<"月份\t編號\t姓名\t基本工資\t津貼\t房帖\t交通補貼\t房租\t儲蓄\t交通費\t會費\t個人所得稅\t應發工資\t應扣工資\t實際工資"<<endl;
while(p)
{
print(p);
p=p->next;
}
cout<<endl;
return;
}
/////////////////////////////////////////////////////////////////////////
void worker::search(int code) //在當前鏈表查找指定記錄並輸出
{
cout<<"searching....."<<endl;
worker_inf *p=find(code);
if(p)
{
cout<<"月份\t編號\t姓名\t基本工資\t津貼\t房帖\t交通補貼\t房租\t儲蓄\t交通費\t會費\t個人所得稅\t應發工資\t應扣工資\t實際工資"<<endl;
print(p);
}
cout<<endl;
}
//////////////////////////////////////////////////////////////////////////
worker_inf *worker::find(int code) //查找條例條件的記錄,並返回該指針
{
if(listcount==0)
{
cout<<"錯誤:當前列表為空!"<<endl;
return NULL;
}
worker_inf *p=head;
while(p)
{
if(p->code==code)break;
p=p->next;
}
if(!p)
{
cout<<"錯誤:找不到該記錄!\n";
return NULL;
}
return p;
}
//////////////////////////////////////////////////////////////////////////
float worker::theorynumber() //計算應發數
{
int i;
if(listcount()==0)
{
cout<<"錯誤:當前的列表為空!"<<endl;
return -1;
}
float sum;
worker_inf *p=head;
while(p)
{
sum=0;
for(i=0;i<4;i++)
sum+=p->get[i];
p->theory_num=sum;
p=p->next;
}
return 0;
}
//////////////////////////////////////////////////////////////////
float worker::tax_num() //計算個人所得稅
{
if(listcount==0)
{
cout<<"錯誤:當前的列表為空!"<<endl;
return -1;
}
worker_inf *p=head;
while(p)
{
float s;
s=p->theory_num;
if(s<=800)
p->theory_num=0;
else if(s<=2000) p->theory_num=(s-800)*0.05;
else if(s<=5000)
p->theory_num=(s-2000)*0.1+60;
else p->theory_num=(s-5000)*0.2+360;
p=p->next;
}
return 0;
}
///////////////////////////////////////////////////////////////////////
float worker::recenumber() //計算應扣數
{
int i;
if(listcount==0)
{
cout<<"錯誤:當前的列表為空!"<<endl;
}
float sum;
worker_inf *p=head;
while(p)
{
sum=0;
for(i=0;i<4;i++)
sum+=p->pay[i];
p->rece_num=p->tax+sum;
p=p->next;
}
return 0;
}
/////////////////////////////////////////////////////////////////////////
float worker::practicenumber() //計算實發數
{
if(listcount()==0)
{
cout<<"錯誤:當前的列表為空!"<<endl;
return -1;
}
worker_inf *p=head;
while(p)
{
float a,b;
a=p->theory_num;
b=p->rece_num;
p->practice_num=a-b;
p=p->next;
}
return 0;
}
////////////////////////////////////////////////////////////////////////////
worker worker; //定義全局變數
int menu()
{
int select=-1;
cout<<"*****************主菜單***********************"<<endl<<endl;
cout<<"1.添加職工信息;"<<endl<<endl;
cout<<"2.刪除職工信息;"<<endl<<endl;
cout<<"3.修改職工的工資信息;"<<endl<<endl;
cout<<"4.按職工編號查找記錄;"<<endl<<endl;
cout<<"5.列出所有記錄;"<<endl<<endl;
cout<<"6.從數據文件導入當月工資信息;"<<endl<<endl;
cout<<"7.將當月工資信息導出到磁碟文件;"<<endl<<endl;
cout<<"0.安全退出系統;"<<endl<<endl;
cout<<"[請選擇(輸入相應的數字)]:";
cin>>select;
return select;
}
/////////////////////////////////////////////////////////////////////////////
char exit()
{
char s;
cout<<"確定要退出程序嗎?[Y/N]:";
cin>>s;
return s;
}
//////////////////////////////////////////////////////////////////////////////
void input(int *month,int*code,string *name,float get[4],float pay[4]) //輸入職工信息
{
cout<<"請輸入月份 編號 姓名 基本工資 津貼 房帖 交通補貼 房租 儲蓄 交通費 會費:"<<endl;
cin>>*month;
cin>>*code;
if(*code==-1)return;
cin>>*name>>get[0]>>get[1]>>get[2]>>get[3]>>pay[0]>>pay[1]>>pay[2]>>pay[3];
return;
}
///////////////////////////////////////////////////////////////////////////////
void addnew() //增加記錄
{
int month=0,code=0;float get[4]={0},pay[4]={0};
string name="";
cout<<endl<<"當輸入的職工編號為-1時表示輸入結束。"<<endl;
input(&month,&code,&name,get,pay);
while(code!=-1)
{
worker.additem(month,code,name,get,pay);
worker.tax_num();
worker.theorynumber();
worker.recenumber();
worker.practicenumber();
input(&month,&code,&name,get,pay);
}
return;
}
////////////////////////////////////////////////////////////////////////////////
void dofind() //按職工編號查找
{
int code;
cout<<endl<<"當輸入的編號為-1時表示結束輸入."<<endl;
do
{
cout<<"請輸入要查找的職工的編號:";
cin>>code;
if(code==-1)continue;
worker.search(code);
}while(code!=-1);
return;
}
/////////////////////////////////////////////////////////////////////////////////
void dodelete() //刪除職工信息
{
cout<<endl<<"當輸入的編號為-1時表示輸入結束."<<endl;
int code;
do
{
cout<<"請輸入要刪除的職工的編號:";
cin>>code;
if(code==-1)continue;
worker.removeitem(code);
}while(code!=-1);
return;
}
///////////////////////////////////////////////////////////////////////////////////
void domodify() //修改職工信息
{
int code;
cout<<"當輸入職工編號為-1時表示結束修改"<<endl;
while(1){
cout<<"請輸入所需修改職工編號";
cin>>code;
if(code==-1)return;
else
worker.changeitem(code);
}
return;
}
///////////////////////////////////////////////////////////////////////////////////
void SaveFilethism()//將當月工資信息寫入文件
{
worker_inf *p;
char name[20];
fstream iofile;
int i=0;
iofile.open("Worker_5th.dat",ios::out|ios::binary);
if(!iofile)
{
cerr<<"open error!"<<endl;
abort();
}
p=worker.get_head();
while(p)
{
p->name.(name,20,0);
name[p->name.length()]=0;
iofile.write((char *) &p->code,sizeof(int));
iofile.write((char *) &p->month,sizeof(int));
iofile.write((char *) name,20);
for(int i=0;i<4;i++)
{
iofile.write((char *) &p->get[i],sizeof(float));
}
for(int j=0;j<4;j++)
{
iofile.write((char *) &p->pay[j],sizeof(float));
}
p=p->next;
}
iofile.close();
cout<<"成功將工資信息存入文件"<<endl;
}
////////////////////////////////////////////////////////////////////////
void Loadfilethism() //讀取當月全體職工的工資信息文件
{
int month,code;
char name[20]="";
float get[4],pay[4];
fstream iofile;
int i=0;
iofile.open("Worker_5th.dat",ios::in|ios::binary);
if(!iofile)
{
cout<<"數據文件不存在,請先建立該文件"<<endl;
return;
}
if(iofile.eof())
{
cout<<"資料庫為空,請先添加數據"<<endl;
iofile.close();
}
else
{
while(iofile.peek()!=EOF)//peek()是取文件當前指針,EOF是文件尾標符
{
iofile.read((char *) &code,sizeof(int));
iofile.read((char *) &month,sizeof(int));
iofile.read((char *) name,20);
for(int i=0;i<4;i++)
{
iofile.read((char *) &get[i],sizeof(float));
} for(int j=0;j<4;j++)
{
iofile.read((char *) &pay[j],sizeof(float));
}
worker.additem(code,month,name,get,pay);
}
worker.tax_num();
worker.theorynumber();
worker.recenumber();
worker.practicenumber();
iofile.close();
cout<<"成功導入工資信息"<<endl;
}
}
/////////////////////////////////////////////////////////////////////////
void list()
{
worker.list();
}
/////////////////////////////////////////////////////////////////////////
int main()
{
cout<<"******************歡迎進入職工工資管理系統*******************"<<endl<<endl;
int select;
char s;
while(1)
{
select=menu();
switch(select)
{
case 0: //退出程序
s=exit();
if(s=='y'||s=='Y') return 0;
break;
case 1: //增加新記錄
addnew();
break;
case 2: //刪除記錄
dodelete();
break;
case 3: //修改記錄
domodify();
break;
case 4: //按條件查找
dofind();
break;
case 5: //列出全部記錄
list();
break;
case 6: //導入當月職工記錄
Loadfilethism();
break;
case 7: //將職工記錄存入磁碟
SaveFilethism();
break;
default:
cout<<"此輸入無效!"<<endl;
}
}
return 0;
}
⑥ C++課程設計:公司工資管理系統
我上次寫了個簡單的工資管理系統就要700行,你這個得幾千行換50積分。不太現實吧~再說我是用C語言寫的。。
⑦ 管理信息系統課程設計 步驟如下: 選題 ××公司工資管理系統 包含內容(四個步驟) Ⅰ.系統規化 Ⅱ.系統
比較麻煩
⑧ 課程設計:小型企業工資管理系統 資料庫 用vf的! 做好發到我的郵箱:[email protected] 謝謝
學生管理系統的抄工作主要是對學生基本情況,學生成績,考試和用戶進行管理的現代化的管理信息系統。每個管理模塊都包括數據輸入、修改、刪除、追加、查詢等功能,學生管理系統能高效、准確地完成這些功能,並達到界面美觀友好、使用方便。其開發主要包括前端應用程序的開發以及後台資料庫的建立和維護兩個方面。對於前者要求應用程序功能完備,易使用等特點。而對於後者則要求建立起數據一致性和完整性強、數據安全性好的庫。實現的方法主要是Microsoft公司的Visual Studio 系列中的 Visual foxpro 開發工具來完成界面與資料庫的開發工作。
...........『
請你查看信件!!~~