




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、;.作者:周鳴需求分析:本程序設(shè)計的任務為銀行自助存取款機,程序要求實現(xiàn)atm機的基本功能,如 開戶.查詢.存款.取款.轉(zhuǎn)賬.容而生成操作日志。2. 概要設(shè)計:數(shù)據(jù)類型:int,char,F(xiàn)ILE.主程序流程:int main ()1:進入dl()函數(shù)。2:核對輸入賬戶與密碼。3. 核對成功則進入dljm()函數(shù)。4. 選擇操作功能。5. 完成操作,回到功能選擇一欄。6. 可選擇退卡以結(jié)束所有操作。標準函數(shù)名稱和自定義名稱:Void dl ()Void dljm ()Void cx()Void ck()Void qk()Void zz()開始程序 開始程序3. 主程序的流程及各函數(shù)之間的流程關(guān)
2、系。(用圖來描述) 進入dl函數(shù) 輸入賬號 輸入密碼進入dljm函數(shù)選擇atm機功能輸入“100”,退出函數(shù)進入zz函數(shù)進入tk函數(shù)進入ck函數(shù)進入qk函數(shù)進入cx函數(shù)15432#include<stdio.h>#include<stdlib.h>int x,k;void dl();int dljm();void cx();void qk();void zz();void ck();void tk();FILE *fp;FILE *fg;struct atm char name10; int account; short password; float money;at
3、10="AA",1,1,4000,"BB",2,2,4000,"CC",3,3,4000, "DD",4,4,4000,"EE",5,5,4000,"GG",6,6,4000, "HH",7,7,4000,"II",8,8,4000,"JJ",9,9,4000, "kk",10,10,4000;void main() char filename="zhouming.txt" c
4、har mode="w",b="AA 1 1 4000 BB 2 2 4000 CC 3 3 4000 DD 4 4 4000 EE 5 5 4000 GG 6 6 4000 HH 7 7 4000 II 8 8 4000 JJ 9 9 4000 KK 10 10 4000" clrscr(); if(fg=fopen("x.txt","a+")=NULL) printf("cannot open the file zhouming!strike any exit"); getch(); exi
5、t(1); dl();if(fp=fopen(filename,mode)!=NULL)fputs(b,fp);fclose(fp); void dl()int account,i,j;short password;printf("please enter the card number:");fprintf(fg,"please enter the card number:n");scanf("%d",&account);fprintf(fg,"%dn",account);if(account>10
6、)dl();for(k=0;k<=9;k+)if(account=atk.account) x=k;fprintf(fp,"please enter the card number:%dn");printf("please enter password:");fprintf(fg,"please enter password:n");scanf("%d",&password);fprintf(fg,"%dn",password);for(i=1;i<4;i+)if(passw
7、ord=atk.password) fprintf(fg,"please enter the password:%dn");printf("log in successfully,please select operationn");fprintf(fg,"log in successfully,please select operationn");dljm();break;elseprintf("password input errorn");printf("enter password again!&
8、quot;);fprintf(fg,"password input errorn");fprintf(fg,"enter password again!n");scanf("%d",&password);fprintf(fg,"%dn",password);while(i=3)system("cls");main(); int dljm()int z;printf("query balance-1n");printf("withdrawals-2n"
9、;);printf("deposit-3n");printf("transfer-4n");printf("take the card-5n");fprintf(fg,"query balance-1n");fprintf(fg,"withdrawals-2n");fprintf(fg,"deposit-3n");fprintf(fg,"transfer-4n");fprintf(fg,"take the card-5n");while
10、(1)printf("nn please enter serial number:");fprintf(fg,"nn please enter sercial number:");scanf("%d",&z);fprintf(fg,"%dn",z);switch(z)case 1:fprintf(fg,"query balancen");cx();break;case 2:fprintf(fg,"withdrawalsn");qk();break;case 3:fpr
11、intf(fg,"deposit n");ck();break;case 4:fprintf(fg,"transfern");zz();break;case 5:fprintf(fg,"take the cardn");tk();break;default:fprintf(fg,"operation sequence number is illegal");printf("operation sequence number is illeagal!");return; void cx()prin
12、tf("%s your card balance:%7.2f yuan",,atk.money);fprintf(fg,"%s your card balance:%7.2f yuan",,atk.money);void qk()float a;printf("please enter withdrawal amount:");fprintf(fg,"please enter withdrawal amount:");scanf("%f",&a);fpri
13、ntf(fg,"%fn",a);if(a>atk.money)printf("lack of balance");fprintf(fg,"lack of banlance");elseprintf("you have taken out %7.2f yuan ",a);fprintf(fg,"you have taken out %7.2f yuan",a);atk.money=atk.money-a; void zz() float a;int t,account,i=1; printf
14、("please enter transfer amount:"); fprintf(fg,"please enter transfer amount:"); scanf("%f",&a); fprintf(fg,"%nf",a); if(a>atk.money) printf("lack of money,please input again!"); fprintf(fg,"lack of money,please input again!"); scanf(
15、"%f",&a); fprintf(fg,"%fn",a); printf("please enter the transfered bank account:"); fprintf(fg,"please enter the transfered bank account:"); scanf("%d",&account); fprintf(fg,"%dn",account);while(i!=3) for(t=0;t<=9;t+) if(account=
16、att.account) x=t; atk.money=atk.money-a; att.money=att.money+a; printf("transfer success !"); fprintf(fg,"transfer success!"); dljm(); if(t>9) break; i=i+1; printf("error! input again!n"); fprintf(fg,"error!input again!n"); scanf("%d",&account
17、); fprintf(fg,"%dn",account); if(i=3) system("cls"); main(); void ck()int a;int i;printf("please put the money into the slotn");fprintf(fg,"please put the money into the slotn");for(i=0;i<1000000000000000;i+);scanf("%d",&a);fprintf(fg,"%d
18、n",a);printf("please make sure the number of bill !n");fprintf(fg,"please make sure the number of bill!n");atk.money=atk.money+a;fprintf(fg,"operation is successful");printf("operation is successful"); void tk() int i,j;printf("please get back your card n");fprintf(fg,"please get back your cardn");for(i=0;i<1000000000000000;i+);system("cls");main();printf("ent
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 商家合作協(xié)議合同
- 農(nóng)業(yè)技術(shù)服務合同協(xié)議
- 人力資源招聘合同
- 房改房二手房買賣合同
- 服務器維護服務類合同
- 集體土地買賣合同
- 砂石材料供貨合同
- 智慧園區(qū)開發(fā)建設(shè)合同
- 設(shè)備買賣居間合同
- 山西金融職業(yè)學院《數(shù)據(jù)可視化理論與實踐》2023-2024學年第二學期期末試卷
- 四川省達州市達川區(qū)2023-2024學年八年級下學期期末道德與法治試題
- 職業(yè)技術(shù)學院環(huán)境工程技術(shù)專業(yè)《水處理技術(shù)》課程標準
- 2024年中國國際航空股份有限公司校園招聘考試試題含答案
- 2023-2024學年統(tǒng)編版語文 七年級下冊第21課《古代詩歌五首-己亥雜詩(其五)》課件
- 駕駛證延期申請委托書
- 【公路工程的發(fā)展趨勢與思考探究6600字(論文)】
- Unit1RelationshipsLesson2HowDoWeLikeTeachers'Feedback-課件高中英語北師大版選擇性
- 適合老年病科護士小講課
- 中國下肢骨折術(shù)后負重專家共識
- 統(tǒng)編版道德與法治三年級下冊全冊教學課件
- 山東萊陽核電項目一期工程水土保持方案
評論
0/150
提交評論