已閱讀5頁,還剩4頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
- 9 -青島理工大學(xué)C語言程序?qū)嵙?xí)題目 職工信息管理系統(tǒng) 指導(dǎo)教師: 姓名: 學(xué)號(hào): 班級(jí): 專業(yè): 地點(diǎn): 時(shí)間: 一、職工信息管理系統(tǒng)本系統(tǒng)主要功能是實(shí)現(xiàn)職工信息的管理,主要有三個(gè)功能:1、建立職工信息2、查詢職工信息;3、修改職工信息。4.輸出職工信息二、上機(jī)環(huán)境:操作系統(tǒng):windowsXP開發(fā)工具:VC6.0三、函數(shù)調(diào)用關(guān)系:main函數(shù)stablishaltersearchoutput四、各函數(shù)功能說明 1.main()函數(shù): 主函數(shù) ,通過調(diào)用各個(gè)函數(shù)實(shí)現(xiàn)職工信息管理2.creat()函數(shù) : 新建職工信息3.search()函數(shù) : 按編號(hào)查詢某員工信息4.alter()函數(shù): 修改員工信息5.output()函數(shù) : 按文件名輸出員工信息五、各個(gè)函數(shù)算法描述或流程圖stablish開始switchaltersearchoutput結(jié)束六、程序運(yùn)行效果圖1運(yùn)行主界面2、建立文件界面3.職工信息查詢界面4.輸出信息七、體會(huì)在本學(xué)期學(xué)習(xí)中,通過學(xué)習(xí)C程序設(shè)計(jì)課,我懂得了C語言是計(jì)算機(jī)語言的基礎(chǔ),必須學(xué)好它,才能更進(jìn)一步的發(fā)展自己,我現(xiàn)在只是初學(xué)者,還有很多的不足,需要改正和完善。在以后的學(xué)習(xí)中我會(huì)更加端正我的學(xué)習(xí)態(tài)度,認(rèn)真學(xué)好每一個(gè)細(xì)節(jié),努力學(xué)好這門課程。此次所編程序尚有很多漏洞,有待完善。八、參考文獻(xiàn)1 譚浩強(qiáng) .C程序設(shè)計(jì)(第三版).清華大學(xué)出版社,2005 2 譚浩強(qiáng) .C程序設(shè)計(jì)題解與上機(jī)指導(dǎo)(第三版).清華大學(xué)出版社,20053 湛為芳C語言程序設(shè)計(jì)技術(shù)清華大學(xué)出版社,20064 電腦編程技巧與維護(hù)雜志社. 電腦編程技巧與維護(hù).人民郵電出版社,20075 楊開城.C語言程序設(shè)計(jì)教程、實(shí)驗(yàn)與練習(xí)(第二版). 人民郵電出版社,2006九、程序清單#include#include#include#define A %-8s %-10s %-7s %-7s %-15s %-8s %-10s %-10s n#define jilu cleq.num,,cleq.sex,cleq.age,cleq.addr,cleq.salary,cleq.health,cleq.bach,cleq.moreusing namespace std;struct clerk/*定義結(jié)構(gòu)體*/char num12;char name15;char sex6;char age6;char addr20;char salary8;char health10;char bach10;char more30;cle30;char filename20;/*文件名*/FILE *fp;/*文件指針*/ int p;void main() void stablish(); /* 函數(shù)聲明*/ void alter(); void search(); void output();int q; /* 設(shè)置變量i為功能選擇變量*/printf(Please choose the number of the operating:n 1 Information Enrollmentn 2 Information Searchingn 3 Information Alteringn 4 Information Outputn 5 close the systemn);printf(If its the first time for you to use the program ,please regist the clerks information. n);scanf(%d,&q);switch(q) case 1:stablish();break; /*函數(shù)調(diào)用:選擇創(chuàng)建功能*/ case 2:search();break; /*用break跳出*/case 3:alter();break;case 4:output();break; case 5: cout正在關(guān)閉系統(tǒng).endl;exit(0);default:cout您的輸入有誤,請(qǐng)重新輸入endl;main();void stablish() /*職工登記函數(shù)*/int q; printf(n請(qǐng)輸入文件名: );scanf(%s,filename); /*創(chuàng)建一個(gè)文件的名字*/if(fp=fopen(filename,w)=NULL) /*打開文件,實(shí)現(xiàn)向文件輸入數(shù)據(jù)*/printf(n不能建立!);exit(0);fprintf(fp,A,編號(hào),姓名,性別,年齡,地址,工資,健康狀況,學(xué)歷,備注);printf(Please input the summary number of the clerks:);scanf(%d,&p);printf(Please input the clerks information:n);for(q=0;qp;q+) printf(編號(hào): );/*將數(shù)據(jù)寫入文件*/scanf(%s,cleq.num);printf(姓名: );scanf(%s,);printf(性別: ); scanf(%s,cleq.sex);printf(年齡: );scanf(%s,cleq.age);printf(地址: );scanf(%s,cleq.addr);printf(工資: );scanf(%s,cleq.salary);printf(健康狀況: );scanf(%s,cleq.health);printf(學(xué)歷: );scanf(%s,cleq.bach);printf(備注: );scanf(%s,cleq.more);printf(n);fprintf(fp,A,cleq.num,,cleq.sex,cleq.age,cleq.addr,cleq.salary,cleq.health,cleq.bach,cleq.more);fclose(fp);printf(Regist end!n);main(); void search() /*查詢函數(shù)*/int t=0,q;char namestr15;printf(Please input the file you want to search:);scanf(%s,filename);printf(nPlease input the clerks name:);scanf(%s,namestr); if(fp=fopen(filename,rb)=NULL) /*打開文件*/printf(nCant open the file!);exit(0);for(q=0;q30;q+)fscanf(fp,%s%s%s%s%s%s%s%sn,jilu);if(strcmp(namestr,)=0)printf(n Successfully search,the information is:n);printf(%-8s %-10s %-7s %-7s %-15s %-8s %-10s %-10sn,編號(hào),姓名,性別,年齡,地址,工資,健康狀況,學(xué)歷,備注);printf(A,jilu);t=1; if(t=0)printf(nn Sorry,cant found related information,please review it!);fclose(fp);void alter() int q; char name15; printf(please input the files name where the information is.); scanf(%s,filename);if(fp=fopen(filename,r+)=NULL)printf(cant open this filen);printf(please input the clerks name);scanf(%s,name);for(q=0;qp;q)fread(&cleq,sizeof(struct clerk),1,fp);if(strcmp(name,)=0) /* 調(diào)用字符串比較函數(shù)*/printf(have found the related information :);break; printf(please input the new information.n);printf(編號(hào): );/*將數(shù)據(jù)寫入文件*/printf(%s,cleq.num);printf(姓名: );scanf(%s,);printf(性別: );scanf(%s,cleq.sex);printf(年齡: );scanf(%s,cleq.age);printf(地址: );scanf(%s,cleq.addr);printf(工資: );scanf(%s,cleq.salary);printf(健康狀況: );scanf(%s,cleq.health);printf(學(xué)歷: );scanf(%s,cleq.bach);printf(備注: );scanf(%s,cleq.more);fwrite(&cleq,sizeof(struct clerk),1,fp);printf(The altered information is :);printf(A,jilu);printf( Altering ended!);void output()int q=0;printf(please input the file you want to put out.);scanf(%s,filename);if(fp=fopen(filename,r)=NULL) /*打開文件*/pri
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年其他計(jì)算機(jī)信息服務(wù)合作協(xié)議書
- 2025年聚氧乙烯醚合作協(xié)議書
- 2025年谷胱甘肽及酵母提取物合作協(xié)議書
- 2025年中外合資經(jīng)營(yíng)員工企業(yè)勞動(dòng)合同(2篇)
- 2025年中學(xué)一年級(jí)班主任工作小結(jié)模版(三篇)
- 2025年二手房出租合同簡(jiǎn)單版(2篇)
- 2025年個(gè)人租房合租協(xié)議(2篇)
- 2025年個(gè)人承租房屋協(xié)議范文(2篇)
- 2025年代理商項(xiàng)目合作協(xié)議范文(2篇)
- 2025年交通事故賠償諒解協(xié)議(2篇)
- 二零二五版財(cái)務(wù)顧問保密與工作內(nèi)容協(xié)議3篇
- 2025-2030年中國(guó)干混砂漿行業(yè)運(yùn)行狀況及發(fā)展趨勢(shì)預(yù)測(cè)報(bào)告
- 2025年度部隊(duì)食堂食材采購(gòu)與質(zhì)量追溯服務(wù)合同3篇
- 2025江蘇鹽城市交通投資建設(shè)控股集團(tuán)限公司招聘19人高頻重點(diǎn)提升(共500題)附帶答案詳解
- 新人教版一年級(jí)下冊(cè)數(shù)學(xué)教案集體備課
- 2024托管班二人合伙的協(xié)議書
- 《輸電線路金具識(shí)別》課件
- 2023-2024學(xué)年浙江省金華市武義縣七年級(jí)(上)期末英語試卷
- 任務(wù)型閱讀 -2024年浙江中考英語試題專項(xiàng)復(fù)習(xí)(解析版)
- 繪本 課件教學(xué)課件
- 大型央國(guó)企信創(chuàng)化與數(shù)字化轉(zhuǎn)型規(guī)劃實(shí)施方案
評(píng)論
0/150
提交評(píng)論