C語言模擬ATM機(jī)_第1頁
C語言模擬ATM機(jī)_第2頁
C語言模擬ATM機(jī)_第3頁
C語言模擬ATM機(jī)_第4頁
C語言模擬ATM機(jī)_第5頁
已閱讀5頁,還剩16頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上一、 實(shí)驗(yàn)?zāi)康耐ㄟ^設(shè)計(jì)一個(gè)ATM機(jī)模擬操作的程序,全面運(yùn)用課程的主要知識(shí)點(diǎn),鞏固對(duì)模塊化程序設(shè)計(jì)、文件操作的理解,提高軟件編程能力。二、 實(shí)驗(yàn)要求要求每人獨(dú)立完成設(shè)計(jì),編寫一個(gè)ATM機(jī)模擬操作程序。提交實(shí)驗(yàn)報(bào)告、源程序、程序運(yùn)行截圖。1. 程序具有以下功能:1) 登錄系統(tǒng):輸入卡號(hào)(16位)、密碼(6位),只有卡號(hào)、密碼同時(shí)正確(帳戶信息存放在文件中)才能進(jìn)入系統(tǒng);2) 操作功能:l 查詢:查詢帳戶的存款余額。按任意鍵返回主菜單;l 修改密碼:連續(xù)輸入兩次新密碼(兩次輸入結(jié)果完全相同)后,新密碼取代舊密碼,并存放到帳戶信息文件中。之后可返回主菜單;l 取款:輸入50或

2、100的倍數(shù)模擬為取款金額,請(qǐng)注意:取款金額不得超過帳戶余額,操作后帳戶余額應(yīng)相應(yīng)減少。之后可返回主菜單;l 存款:輸入50或100的倍數(shù)模擬為存款金額,現(xiàn)假設(shè)存款金額不得超過20000元,操作后帳戶余額應(yīng)相應(yīng)增加。之后可返回主菜單;l 轉(zhuǎn)帳:先輸入一個(gè)帳戶號(hào)(已保存在帳戶信息文件中),然后顯示一部分用戶名(如:張*山),儲(chǔ)戶確認(rèn)無誤后,再輸入50或100的倍數(shù)模擬為轉(zhuǎn)帳金額,請(qǐng)注意:轉(zhuǎn)帳金額不得超過帳戶余額,操作后帳戶余額應(yīng)相應(yīng)減少。之后可返回主菜單;l 退出:退出系統(tǒng)。2. 定義如下結(jié)構(gòu)體類型:l “日期”結(jié)構(gòu)體Date:成員有:year(年)、month(月)、day(日);l “帳戶”

3、結(jié)構(gòu)體Account:成員有:no(帳戶號(hào))、name(姓名)、balance(余額)l “存取款記錄”結(jié)構(gòu)體Record,:成員有:no(帳戶號(hào))、date(日期)、number(數(shù)量,可正可負(fù),正表示存款,負(fù)表示取款)3. 帳戶信息存放在accounts.txt文件,儲(chǔ)戶存取款記錄保存在records.txt中;4. 采用模塊化程序設(shè)計(jì)方法來實(shí)現(xiàn),即main()顯示主菜單、調(diào)用相關(guān)函數(shù)實(shí)現(xiàn)相應(yīng)功能,起主控作用。5. 附加功能:l 儲(chǔ)戶一天內(nèi)輸錯(cuò)密碼的次數(shù)不能超過3次,否則無法進(jìn)入系統(tǒng);l 應(yīng)避免輸入存款金額、取款金額為負(fù)數(shù)等異常情況的出現(xiàn)。三、 程序已經(jīng)實(shí)現(xiàn)的功能點(diǎn)實(shí)驗(yàn)要求均已實(shí)現(xiàn)。此外還

4、有:1. 卡號(hào)、密碼位數(shù)輸錯(cuò)時(shí),提示并返回重新輸入,2. 簡(jiǎn)化取款時(shí)的輸入3. 轉(zhuǎn)賬時(shí),轉(zhuǎn)賬賬戶為原賬戶時(shí),提示并返回重新輸入4. 在多個(gè)模塊中添加了退出功能,無需回到主菜單即可退出系統(tǒng)5. 在查詢模塊中加入了存取記錄明細(xì)查詢四、 程序運(yùn)行截圖及說明1. 登陸模塊1) 卡號(hào)不為16位時(shí),輸出提示并返回重新輸入2) 卡號(hào)不存在時(shí),輸出提示并返回重新輸入3) 密碼位數(shù)輸錯(cuò)時(shí),輸出提示并返回重新輸入密碼,不作為密碼錯(cuò)誤處理,也無需重新輸入卡號(hào)4) 密碼連續(xù)輸錯(cuò)三次時(shí),鎖定卡號(hào),今日無法登錄2. 登錄后的系統(tǒng)主菜單3. 查詢模塊1) 查詢模塊主菜單2) 查詢明細(xì)4. 取款模塊1) 當(dāng)余額不足50時(shí),無

5、法進(jìn)入取款模塊2) 取款模塊主菜單3) 便捷取款4) 手動(dòng)輸入取款金額輸錯(cuò)時(shí),返回重新輸入5) 取款后的菜單6) 取款完成后選擇顯示余額5. 存款模塊1) 解決輸入錯(cuò)誤問題2) 存款成功6. 密碼修改模塊1) 原密碼輸錯(cuò)時(shí),返回重新輸入,不提供退出功能2) 密碼位數(shù)輸錯(cuò)、兩次輸入新密碼不一致時(shí),返回重新輸入3) 輸入無誤時(shí)7. 轉(zhuǎn)賬模塊1) 轉(zhuǎn)入卡號(hào)位數(shù)輸錯(cuò)時(shí),提示并返回重新輸入2) 未查找到該卡號(hào)時(shí),輸出提示,提供退出功能,鍵入除*外任意鍵重新輸入3) 轉(zhuǎn)入卡號(hào)與當(dāng)前卡號(hào)相同時(shí),輸出提示4) 輸出轉(zhuǎn)入卡賬戶的部分用戶名5) 解決轉(zhuǎn)賬金額輸錯(cuò)的問題6) 轉(zhuǎn)賬成功五、 采用的主要技術(shù)1. 宏定義

6、:由于本程序的printf語句較多,為了便于編寫,故用PR代替2. 鏈表:賬戶信息采用鏈表結(jié)構(gòu),內(nèi)存動(dòng)態(tài)分配,使用內(nèi)存無限制,可以擴(kuò)展到所有可以使用的內(nèi)存3. switch多分支選擇結(jié)構(gòu)4. 文本文件的讀寫5. 利用time.h頭文件,簡(jiǎn)便地獲取系統(tǒng)日期6. system()函數(shù)和fflush()函數(shù)的簡(jiǎn)單使用六、 設(shè)計(jì)心得1. 各函數(shù)的功能要相對(duì)獨(dú)立,逐步求精。2. 如果函數(shù)的參數(shù)為指針,且僅作為輸入?yún)?shù),則應(yīng)在類型前加const,以防止該指針在函數(shù)體內(nèi)被意外修改附:程序代碼/*運(yùn)行本程序前,請(qǐng)?jiān)诒境绦蚋夸浵陆⑽募癮ccounts.txt”,格式如下:*卡號(hào)1(16位)姓名1賬戶余額1

7、密碼1*卡號(hào)2(16位)姓名2賬戶余額2密碼2*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#define PR printftypedef structshort int year;short int month;short int day;Date;/日期typedef struct Accountchar no17;char name20;double balance;char password7;struct Account* next

8、;Account;typedef structchar no17;Date date;double number;Record;/記錄Account *head = NULL;/賬戶信息鏈表表頭Account *now_acc = NULL;/當(dāng)前賬戶 /*函數(shù)申明*/void InitializeAccount();/導(dǎo)入賬戶信息/-char LockAccountTopic(const char *no);/檢測(cè)賬戶是否被鎖定void LockAccount(const char *no);/鎖定賬戶/-void Login();/登錄Account* FindbyNo(const cha

9、r *no);/查找卡號(hào)對(duì)應(yīng)賬戶信息在鏈表中的地址/-void Demand();/查詢主菜單void PrintBalance();/輸出余額void Printetail();/輸出明細(xì)/-void Modifiy();/修改密碼/-void Withdrawal();/取款主界面void WithdrawalOt(long money);/取款/-void Depositing();/存款/-void Transfer();/轉(zhuǎn)賬char *CoverUpName(const char *name);/掩蓋部分用戶名/-void Log(double money, const char

10、*no);/將存款記錄寫入文件中void Save();/保存賬號(hào)信息void FreeData();/釋放鏈表空間/-int main()char choose;InitializeAccount();/導(dǎo)入賬戶信息Login();/登錄dosystem("cls");PR("tt n");PR("tt 請(qǐng)選擇服務(wù) n");PR("tt+-+-+ +-+-+n");PR("tt|5|33轉(zhuǎn) 賬| |查 詢32|1|n");PR("tt+-+-+ +-+-+nn");PR(&

11、quot;tt +-+-+n");PR("tt |取 款32|2|n");PR("tt +-+-+nn");PR("tt +-+-+n");PR("tt |存 款32|3|n");PR("tt +-+-+nn");PR("tt+-+-+ +-+-+n");PR("tt|0|33退出系統(tǒng)| |修改密碼32|4|n");PR("tt+-+-+ +-+-+nn");PR("請(qǐng)選擇服務(wù):");fflush(stdi

12、n);choose = getchar();switch (choose)case '1': Demand(); break;/查詢case '2': Withdrawal(); break;/取款case '3': Depositing(); break;/存款case '4': Modifiy(); break;/修改密碼case '5': Transfer(); break;/轉(zhuǎn)賬case '0': FreeData(); return 0;/退出default:printf("輸入

13、錯(cuò)誤,請(qǐng)重新選擇n"); /解決用戶可能的輸入錯(cuò)誤system("pause"); while (1);return 0;/*導(dǎo)入賬戶信息*/void InitializeAccount()FILE *fp;Account temp;PR("系統(tǒng)初始化中,請(qǐng)稍侯.n");if (!(fp = fopen("accounts.txt", "r")PR("07");/響鈴PR("讀取帳戶信息失敗,請(qǐng)?jiān)诒境绦蚋夸浗粜畔⑽募?accounts.txt)。格式如下:n"

14、;);PR("卡號(hào)1(16位)姓名1賬戶余額1密碼1n");PR("卡號(hào)2(16位)姓名2賬戶余額2密碼2n");PR("n");exit(0);while (fscanf(fp, "%s %s %lf %s", temp.no, , &temp.balance, temp.password) = 4)/讀入賬戶信息Account *t = head;head = (Account*)malloc(sizeof(Account);*head = temp;head->next = t

15、;fclose(fp);system("cls");/清除“系統(tǒng)初始化中,請(qǐng)稍侯.”提示/*登錄*/void Login()dochar no17;system("cls");PR("nnnnttt請(qǐng)輸入16位卡號(hào):");fflush(stdin);gets(no);if (strlen(no) != 16)PR("卡號(hào)應(yīng)為16位n");system("pause");system("cls");continue;if (LockAccountTopic(no)/當(dāng)該卡號(hào)被鎖

16、定時(shí)PR("07");/響鈴PR("nn您的登陸密碼今日連續(xù)輸錯(cuò)三次,已被臨時(shí)鎖定,次日將自動(dòng)解鎖,或當(dāng)日持本人有效證件到柜臺(tái)辦理密碼重置。nn");system("pause");continue;if (!(now_acc = FindbyNo(no)/將卡號(hào)對(duì)應(yīng)信息在鏈表的地址賦給now_acc/當(dāng)卡號(hào)不存在時(shí)PR("nn此卡號(hào)不存在,請(qǐng)重新輸入!nn");system("pause");continue;char a = '2'/計(jì)算剩余可輸錯(cuò)密碼次數(shù)dochar pas

17、sword7;system("cls");PR("nnnnttt請(qǐng)輸入16位卡號(hào):%sn", now_acc->no);PR("nnttt請(qǐng)輸入6位密碼:");fflush(stdin);scanf("%s", password);if (strlen(password) != 6)PR("密碼應(yīng)為6位n");system("pause");system("cls");continue;if (!strcmp(now_acc->password

18、, password)return;/密碼正確,回到主函數(shù)if (a = '0')/輸錯(cuò)密碼三次,鎖定賬戶PR("nn您的登陸密碼今日連續(xù)輸錯(cuò)三次,已被臨時(shí)鎖定,次日將自動(dòng)解鎖,或當(dāng)日持本人有效證件到柜臺(tái)辦理密碼重置。nn");LockAccount(no);break;PR("07");/響鈴PR("密碼輸入錯(cuò)誤,您還可以嘗試%c次nn", a-);system("pause"); while (1); while (1);/*檢測(cè)賬戶是否被鎖定*/char LockAccountTopic(co

19、nst char *no)/被鎖定則返回0FILE *fp;char CruuentTime11;/當(dāng)前日期char ArchiveTime11;/鎖卡檔案日期char t17;if (!(fp = fopen("LockAccount.txt", "a+")/課本上講以“a”方式打開文件,若文件不存在,會(huì)出錯(cuò)。VS2013實(shí)測(cè),并不會(huì)出錯(cuò),而是新建。為免第一次使用本程序時(shí),根目錄下沒有LockAccount.txt而導(dǎo)致出錯(cuò),故此處不采用“r”方式。PR("07");/響鈴PR("LockAccount.txt無法打開nn

20、");exit(0);rewind(fp);/獲取當(dāng)前日期time_t rawtime;struct tm * timeinfo;time(&rawtime);/獲取時(shí)間,以秒計(jì),從1970年1月一日起算,存于rawtimetimeinfo = localtime(&rawtime);/轉(zhuǎn)為當(dāng)?shù)貢r(shí)間,tm 時(shí)間結(jié)構(gòu)strftime(CruuentTime, 11, "%Y-%m-%d", timeinfo);/格式化時(shí)間fgets(ArchiveTime, 11, fp);/獲取鎖卡檔案時(shí)間if (strcmp(ArchiveTime, Cruue

21、ntTime)/若無鎖卡檔案,或鎖卡檔案日期與當(dāng)前日期不同,則無賬戶被鎖定fclose(fp);return 0;while (fscanf(fp, "%s", t) = 1)if (!strcmp(t, no)/鎖卡檔案中,包含此卡號(hào),返回1fclose(fp);return 1;fclose(fp);return 0;/鎖卡檔案中,不含此卡號(hào),返回0/*查找卡號(hào)對(duì)應(yīng)賬戶信息在鏈表中的地址*/Account* FindbyNo(const char *no)for (Account *i = head; i; i = i->next)if (!strcmp(i-&g

22、t;no, no)return i;return NULL;/*鎖定賬戶*/void LockAccount(const char *no)FILE *fp;char CruuentTime11;/當(dāng)前日期char ArchiveTime11;/鎖卡檔案日期if (!(fp = fopen("LockAccount.txt", "r")PR("07");/響鈴PR("error on open LockAccount.txt file!nn");exit(0);/獲取當(dāng)前日期time_t rawtime;struc

23、t tm * timeinfo;time(&rawtime);/獲取時(shí)間,以秒計(jì),從1970年1月1日起算,存于rawtimetimeinfo = localtime(&rawtime);/轉(zhuǎn)為當(dāng)?shù)貢r(shí)間,tm 時(shí)間結(jié)構(gòu)strftime(CruuentTime, 11, "%Y-%m-%d", timeinfo);/格式化時(shí)間fgets(ArchiveTime, 11, fp);fclose(fp);if (strcmp(ArchiveTime, CruuentTime)/若檔案日期與當(dāng)前日期不同,則說明檔案已過期或無檔案,新建記錄。if (!(fp = fo

24、pen("LockAccount.txt", "w")PR("07");/響鈴PR("error on open LockAccount.txt file!nn");exit(0);fprintf(fp, "%sn", CruuentTime);else/若記錄日期與當(dāng)前日期相同,則追加記錄if (!(fp = fopen("LockAccount.txt", "a")PR("07");/響鈴PR("error on open

25、 LockAccount.txt file!nn");exit(0);/添加記錄fprintf(fp, "%sn", no);fclose(fp);/*查詢函數(shù)主菜單*/void Demand()char choose;dosystem("cls");PrintBalance();PR("ttttt +-+-+n");PR("ttttt |查詢明細(xì)32|1|n");PR("ttttt +-+-+nn");PR("tt+-+-+ +-+-+n");PR("t

26、t|0|33退出系統(tǒng)| | 返 回 32|2|n");PR("tt+-+-+ +-+-+nn");PR("請(qǐng)選擇服務(wù):");fflush(stdin);choose = getchar();switch (choose)case '1': Printetail(); break;/查詢明細(xì)case '2': return;/返回case '0': FreeData(); exit(0);/退出系統(tǒng)default:printf("輸入錯(cuò)誤,請(qǐng)重新選擇n"); /解決用戶可能的輸入

27、錯(cuò)誤system("pause"); while (1);/*輸出余額*/void PrintBalance()system("cls");PR("nnnnnnnnntt+-+-+n");PR("tt| 您的賬戶余額 32|%-15.2f|n", now_acc->balance);PR("tt+-+-+nnnnnnn");/*輸出明細(xì)*/void Printetail()FILE *fp;Record temp;int flag = 1;/當(dāng)有記錄時(shí),置0if (!(fp = fopen

28、("records.txt", "r")PR("無存取記錄,請(qǐng)進(jìn)行存取后再使用本功能nn");system("pause");return;system("cls");PR("+-+-+n");PR("| 日期 | 存取金額 |n");PR("+-+-+n");while (fscanf(fp, "%s%d-%d-%d%lf", temp.no, &temp.date.year, &temp.date

29、.month, &temp.date.day, &temp.number) = 5)if (!(strcmp(temp.no, now_acc->no)flag = 0;PR("|%d-%d-%d|%-14.2f|n", temp.date.year, temp.date.month, temp.date.day, temp.number);PR("+-+-+n");PR("| 日期 | 存取金額 |n");/未免記錄太多看不到表頭,在最后加個(gè)表頭PR("+-+-+n");if (flag)s

30、ystem("cls");/無記錄時(shí),清除表頭PR("該卡號(hào)未有任何存取記錄nn");system("pause");return;system("pause");/當(dāng)有存取記錄時(shí),輸出后等待/*將存款記錄寫入文件中*/void Log(double money, const char *no)FILE *fp;Date CruuentTime;/當(dāng)前日期if (!money)/存取為零時(shí)return;if (!(fp = fopen("records.txt", "a")P

31、R("07");/響鈴PR("error on open records.txt file!");exit(0);/獲取當(dāng)前日期time_t rawtime;struct tm * timeinfo;time(&rawtime);/獲取時(shí)間,以秒計(jì),從1970年1月1日起算,存于rawtimetimeinfo = localtime(&rawtime);/轉(zhuǎn)為當(dāng)?shù)貢r(shí)間,tm 時(shí)間結(jié)構(gòu)CruuentTime.year = timeinfo->tm_year + 1900, CruuentTime.month = timeinfo-&g

32、t;tm_mon + 1, CruuentTime.day = timeinfo->tm_mday;fprintf(fp, "%sn%d-%d-%dn%fn", no, CruuentTime.year, CruuentTime.month, CruuentTime.day, money);fclose(fp);/*取款主界面*/void Withdrawal()char choose;if (now_acc->balance < 50.0)/當(dāng)余額不足50時(shí),無法取款PR("07");/響鈴PR("您的余額不足50,無法取款

33、nn");system("pause");return;dosystem("cls");PR("nn");PR("tt+-+-+ +-+-+n");PR("tt|1|33 100 | | 2000 32|5|n");PR("tt+-+-+ +-+-+nn");PR("tt+-+-+ +-+-+n");PR("tt|2|33 500 | | 5000 32|6|n");PR("tt+-+-+ +-+-+nn"

34、);PR("tt+-+-+ +-+-+n");PR("tt|3|33 1000 | |其它金額32|7|n");PR("tt+-+-+ +-+-+nn");PR("tt+-+-+ +-+-+n");PR("tt|4|33退出系統(tǒng)| |返 回32|0|n");PR("tt+-+-+ +-+-+nn");PR("請(qǐng)選擇服務(wù):");fflush(stdin);scanf("%c", &choose);switch (choose)ca

35、se '1': WithdrawalOt(100); break;case '2': WithdrawalOt(500); break;case '3': WithdrawalOt(1000); break;case '4': FreeData(); exit(0);case '5': WithdrawalOt(2000); break;case '6': WithdrawalOt(5000); break;case '7':dolong money;PR("請(qǐng)輸入取款金額

36、(50的倍數(shù)):");fflush(stdin);scanf("%ld", &money);if (money < 0 | money % 50)/解決輸入金額為負(fù)數(shù)、不是50的倍數(shù)的情況PR("輸入有誤,請(qǐng)重新輸入n");system("pause");continue;WithdrawalOt(money);break; while (1);break;case '0': return;default:PR("07");/響鈴printf("輸入錯(cuò)誤,請(qǐng)重新選擇

37、n"); /解決用戶可能的輸入錯(cuò)誤system("pause");continue;/取款完成后的菜單char choose;system("cls");PR("nn");PR("tt +-+-+n");PR("tt |繼續(xù)取款32|1|n");PR("tt +-+-+nn");PR("tt +-+-+n");PR("tt |顯示余額32|2|n");PR("tt +-+-+nn");PR("tt

38、 n");PR("tt n");PR("tt nn");PR("tt+-+-+ +-+-+n");PR("tt|0|33退出系統(tǒng)| |返 回32|3|n");PR("tt+-+-+ +-+-+nn");PR("請(qǐng)選擇服務(wù):");fflush(stdin);scanf("%c", &choose);switch (choose)case '1': continue;/繼續(xù)取款case '2': PrintBa

39、lance(); system("pause"); break;/輸出余額case '3': return;/返回主函數(shù)case '0': FreeData(); exit(0);/退出系統(tǒng)default:PR("07");/響鈴printf("輸入錯(cuò)誤,請(qǐng)重新選擇n"); /解決用戶可能的輸入錯(cuò)誤system("pause"); while (1);/*取款*/void WithdrawalOt(long money)if (now_acc->balance < mon

40、ey)PR("07");/響鈴PR("您的余額不足%ldnn", money);system("pause");return;PR("正在處理,請(qǐng)稍候.n");now_acc->balance -= money;Save();Log(-money, now_acc->no);PR("取款成功nn");system("pause");/*存款*/void Depositing()long money;doPR("請(qǐng)輸入存款金額(50的倍數(shù)),單次存款金額不

41、得超過20000元:");fflush(stdin);scanf("%ld", &money);if (money < 0 | money > 20000 | money % 50)/解決輸入金額為負(fù)數(shù)、超過20000、不是50的倍數(shù)的情況PR("07");/響鈴PR("輸入有誤,請(qǐng)重新輸入n");system("pause");continue;PR("正在處理,請(qǐng)稍候.n");now_acc->balance += money;Save();/保存賬戶數(shù)據(jù)

42、Log(money, now_acc->no);/保存存取數(shù)據(jù)PR("存款成功nn");system("pause");break; while (1);/*保存賬戶信息*/void Save()FILE *fp;int i = 1;char ch;if (!(fp = fopen("accounts.txt", "w")PR("07");/響鈴PR("讀取帳戶信息失敗!accounts.txt無法打開n");exit(0);for (Account *i = head

43、; i; i = i->next)/寫入賬戶信息fprintf(fp, "%s %s %f %sn", i->no, i->name, i->balance, i->password);fclose(fp);/*修改密碼*/void Modifiy()char oldpass7, newpass17, newpass27;doPR("請(qǐng)輸入原密碼:");fflush(stdin);gets(oldpass);if (strlen(oldpass) != 6)PR("密碼應(yīng)為6位n");system(&qu

44、ot;pause");continue;if (strcmp(oldpass, now_acc->password)/解決密碼輸入有誤,出于安全性的考慮,原密碼輸入錯(cuò)誤時(shí)不提供返回功能PR("密碼有誤,請(qǐng)重新輸入nn");system("pause");continue;elsebreak; while (1);doPR("請(qǐng)輸入六位新密碼:");fflush(stdin);scanf("%s", newpass1);if (strlen(newpass1) != 6)PR("密碼應(yīng)為6位

45、n");system("pause");continue;PR("請(qǐng)?jiān)俅屋斎胄旅艽a:");fflush(stdin);scanf("%s", newpass2);if (strcmp(newpass1, newpass2)/兩次輸入密碼不一致時(shí)PR("密碼不一致(輸入*取消修改)n");fflush(stdin);if (getchar() = '*')break;else/輸入一致時(shí)strcpy(now_acc->password, newpass1);/修改密碼Save();/保

46、存用戶數(shù)據(jù)PR("密碼修改成功!nn");system("pause");break; while (1);/*轉(zhuǎn)賬*/void Transfer()Account* aimsite;/轉(zhuǎn)入卡號(hào)在鏈表中的地址long money;/轉(zhuǎn)賬金額if (now_acc->balance < 50)/當(dāng)賬戶余額不足50時(shí)PR("07");/響鈴PR("您的余額不足50,無法轉(zhuǎn)賬nn");system("pause");return;dochar aim17;/轉(zhuǎn)入卡號(hào)PR("請(qǐng)輸入轉(zhuǎn)入卡/折號(hào)(16位):");fflush(stdin);gets(aim);if (strlen(aim) != 16)PR("卡號(hào)應(yīng)為16位n");system("pause");continue;if (!(strcmp(aim, now_acc-&

溫馨提示

  • 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. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論