c語言課程設計---職工信息管理系統_第1頁
c語言課程設計---職工信息管理系統_第2頁
c語言課程設計---職工信息管理系統_第3頁
c語言課程設計---職工信息管理系統_第4頁
c語言課程設計---職工信息管理系統_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、精選優(yōu)質文檔-傾情為你奉上精選優(yōu)質文檔-傾情為你奉上專心-專注-專業(yè)專心-專注-專業(yè)精選優(yōu)質文檔-傾情為你奉上專心-專注-專業(yè)C語言課程設計設計題目:職工信息管理系統設計目的當今時代是飛速發(fā)展的信息時代,在各行各業(yè)中離不開信息處理,這正是計算機被廣泛應用于信息系統的環(huán)境。計算機的最到好處的于利用它能夠進行信息管理,使用計算機進行信息控制,不僅提高了工作效率,而且大大的提高了其安全性。尤其對于復雜的信息管理,計算機能夠充分發(fā)揮它的優(yōu)越性。計算機進行信息管理與信息管理系統的開發(fā)密切相關,系統的開發(fā)是系統管理的前提。本系統就是為了管理好學生選課信息而設計的。數據處理手工操作,工作量大,出錯率高,出錯

2、后不易更改,造成了時間上的浪費?;谶@個問題,我認為有必要建立一個學生選課系統,使學生選課信息管理工作規(guī)范化、系統化、程序化,避免學生選課管理的隨意性,提高信息處理的速度和準確性,能夠及時、準確、有效的查詢和修改選課情況。二、題目說明: 系統功能簡介:系統以菜單方式工作職工信息錄入(文件保存職工信息)輸出職工信息、瀏覽職工信息查詢職工信息根據員工號查找職工信息根據工資、年齡、性別對職工信息進行排序刪除職工信息3. 設計實施:#include #include #include typedef struct Empk int EmpNum; /* staff number */ char Emp

3、Name12; /* name*/ int Sex; /*sex 1- woman 2- man*/ int Old; /* old*/ int Cult; /*education background 1-specilist 2-doctor 3-others*/ int Salary; /*salary*/ char Address12; /* address*/ int Tell; /*telephone number*/Emp;Emp emp100;void open() int i; FILE *fp; if(fp=fopen(wyl,rb+)=NULL) printf(can no

4、t do it! Because of no file of informationn); exit(0); for(i=0;i100;i+) if(fread(&empi,sizeof(Emp),1,fp)=0) printf(Fail to outputn); exit(0); fclose(fp);void close() /*跳出*/ int i; FILE *fp; if(fp=fopen(wyl,wr+)=NULL) printf(can not do it!n); exit(0); for(i=0;i100;i+) fwrite(&empi,sizeof(Emp),1,fp);

5、fclose(fp);void inputEmpInfo() /*輸入信息*/ int i,k; for(i=0;i100;i+) printf(Please enter the staffs :nnumber:); scanf(%d,&empi.EmpNum); printf(nname:); scanf(%s,empi.EmpName); printf(nsex : 1- woman 2- man:); scanf(%d,&empi.Sex); printf(nold:); scanf(%d,&empi.Old); printf(nEducation background:1-specia

6、list 2-doctor 3-others); scanf(%d,&empi.Cult); printf(nsalary:); scanf(%d,&empi.Salary); printf(naddress:); scanf(%s,empi.Address); printf(ntellphone:); scanf(%d,&empi.Tell); printf(continue?(1.yes 2.no); scanf(%d,&k); if(k=2) break; close();void reorder() /*修改*/int i,s,j,k,l;Emp temp;open();printf(

7、nChoose which category would you want to usen1-sex n2-salary(from maximum to minimum) n3-old (from maximum to minimum) n ( enter the corresponding nember) n);scanf(%d,&i);switch(i) case 1:printf(nchoose which sex do you want to inquire? 1-woman 2 -man );scanf(%d,&s);for(j=0;empj.EmpNum!=0;j+) if(emp

8、j.Sex=s) printf( number:%dn,empj.EmpNum); printf(name:%s, empj.EmpName); printf(nsex 1- woman 2- man:%d, empj.Sex); printf(nold:%d, empj.Old); printf(neducation background:%dttt 1-specialist 2-doctor 3-others ,empj.Cult); printf(nsalary:%d, empj.Salary); printf(naddress:%s, empj.Address); printf(nte

9、lephone nember :%d, empj.Tell); break;case 2: for(k=0;empk.EmpNum!=0;j+ ) for(l=k;empl.EmpNum!=0;l+) if(empl.Salaryempl+1.Salary) temp=empl;empl=empl+1;empl+1=temp; printf( number:%dn,empk.EmpNum); printf(name:%s,empk.EmpName); printf(nsex 1- woman 2- man:%d,empk.Sex); printf(nold:%d,empk.Old); prin

10、tf(neducation background:%dttt 1-specialist 2-doctor 3-others ,empk.Cult); printf(nsalary:%d,empk.Salary); printf(nadress:%s,empk.Address); printf(ntelephone nember :%d,empk.Tell); break;case 3: for(k=0;empk.EmpNum!=0;j+ ) for(l=k;empl.EmpNum!=0;l+) if(empl.Oldempl+1.Old) temp=empl;empl=empl+1;empl+

11、1=temp; printf( number:%dn,empk.EmpNum);printf(name:%s,empk.EmpName);printf(nsex 1- woman 2- man:%d,empk.Sex);printf(nold:%d,empk.Old);printf(neducation background:%dttt 1-specialist 2-doctor 3-others,empk.Cult);printf(nsalary:%d,empk.Salary);printf(naddress:%s,empk.Address);printf(ntelephone nember

12、 :%d,empk.Tell); break; void show()int j;open();printf(n-informations of sraffs-n);for(j=0;empj.EmpNum!=0;j+) printf(number:%dn,empj.EmpNum); printf(name:%s,empj.EmpName); printf(nsex 1- woman 2- man:%d,empj.Sex); printf(nold:%d,empj.Old); printf(neducation background:%d 1-specialist 2-doctor 3-othe

13、rs ,empj.Cult); printf(nsalary:%d,empj.Salary); printf(nadress:%s,empj.Address); printf(ntelephone nember :%d,empj.Tell); void deleteEmp() int j,k,m=1,d,i=0; open(); printf(Enter the number whose date you want to delete:n); scanf(%d,&d); for(j=0;empj.EmpNum!=0;j+) if(empj.EmpNum=d) for(k=j;empj.EmpN

14、um!=0;k+) empk=empk+1; i+; if(i=0) printf(The staffs informations manage systerm has no date of the number your entered!n); close(); printf(succeeed to deleten);void findByEmpName() /*查詢*/int j,i,k=0;open();printf(Please enter the number :n);scanf(%d,&i);for(j=0;empj.EmpNum!=0;j+) if(empj.EmpNum=i)

15、printf(n-information of your want -n); printf(number:%dn,empj.EmpNum); printf(name:%s,empj.EmpName); printf(nsex 1- woman 2- man:%d,empj.Sex); printf(nold:%d,empj.Old); printf(neducation background:%dtttt 1-specialist 2-doctor 3-others ,empj.Cult); printf(nsalary:%d,empj.Salary); printf(nadress:%s,e

16、mpj.Address); printf(ntelephone number:%d,empj.Tell); k+; if(k=0) printf(nHave no date of the number!n);void menu()printf(n-n); printf(n Wellcome to the staff manage styterm n); printf(n-n); printf(Please choose number for what are you want to do:nn); printf(n 1 - input: Complete inputing workers in

17、formation.); printf(n 2 - reorder: Make the new order of the information.); printf(n 3 - delete: Delete the information of the staff.); printf(n 4 - output: Display all worker of information.); printf(n 5 - inquire.); printf(n 0 - exitn);void main() int op,choice=1; while(choice=1) menu(); printf(nPlease enter your order:n); scanf(%d,&op); switch(op)case 1: inputEmpInfo

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論