简易银行卡管理系统

上传人:kms****20 文档编号:40525933 上传时间:2018-05-26 格式:DOC 页数:13 大小:54KB
返回 下载 相关 举报
简易银行卡管理系统_第1页
第1页 / 共13页
简易银行卡管理系统_第2页
第2页 / 共13页
简易银行卡管理系统_第3页
第3页 / 共13页
简易银行卡管理系统_第4页
第4页 / 共13页
简易银行卡管理系统_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《简易银行卡管理系统》由会员分享,可在线阅读,更多相关《简易银行卡管理系统(13页珍藏版)》请在金锄头文库上搜索。

1、简易银行卡管理系统简易银行卡管理系统#include#include#include#includeusing namespace std;int kaihu(int);void cunkuan(int);void qukuan(int);void xianshiyue(int);void guashi(int);void xiugaimima(int);int xiaohu(int);void xianshi(int);struct messageint sign;char name10;char code20;double cash;/主程序,整体调用的入口int main()messag

2、e users3=0,“zhangsan“,“111“,100,0,“lisi“,“222“,200,0,“wangwu“,“333“,300;fstream file;int i,num=3;char k;char sh;file.open (“xinxi.dat“,ios:out|ios:trunc|ios:binary);if(!file)coutk;switch(k)case(1):num=kaihu(num);break;case(2):cunkuan(num);break;case(3):qukuan(num);break;case(4):xianshiyue(num);break

3、;case(5):guashi(num);break;case(6):xiugaimima(num);break;case(7):num=xiaohu(num);break;case(8):xianshi(num);break;default:coutsh;if(sh=y|sh=Y)goto loop1;else coutaddtemp.name addtemp.code;addtemp.sign=0;addtemp.cash=0;fstream file;file.open (“xinxi.dat“,ios:out|ios:app|ios:binary);/file.seekp(k*size

4、of(message),ios:beg);file.write (char*)couttemp.name temp.code ;for(i=1;ich;if(ch=y|ch=Y)goto loop2;elseif(temp1.sign=1)coutnumcash;temp1.cash=temp1.cash +numcash;file.seekp(i-1)*sizeof(message),ios:beg);file.write (char*)couttemp.name temp.code;for(i=1;ich;if(ch=y|ch=Y)goto loop3;elseif(temp1.sign=

5、1)coutnumcash;if(numcashtemp1.cash)coutsh;if(sh=y)goto loop4;else ;elsetemp1.cash =temp1.cash -numcash;file.seekp(i-1)*sizeof(message),ios:beg);file.write (char*)couttemp.name temp.code ;for(i=1;ich;if(ch=y|ch=Y)goto loop5;elseif(temp.sign =1)couttemp.name temp.code ;for(i=1;ich;if(ch=y|ch=Y)goto lo

6、op6;elseif(temp.sign =1)couttemp.name temp.code ;for(i=1;ich;if(ch=y|ch=Y)goto loop7;elseif(temp1.sign =1)coutsecret;strcpy(temp1.code,secret);file.seekp(i-1)*sizeof(message),ios:beg);file.write (char*)couttemp.name temp.code ;for(i=1;ich;if(ch=y|ch=Y)goto loop8;elseif(temp1.sign =1)cout“该账户已挂失,资金已被

7、冻结,不可操作!“endl;elseif(temp1.cash !=0)cout“该账户还有余额,请取出后再销户“endl;elsetemp1.sign =2 ;strcpy(temp1.name ,temp2.name) ;strcpy(temp1.code ,temp2.code) ;temp1.cash =temp2.cash ;file.seekp(i-1)*sizeof(message),ios:beg);file.write (char*)cout“销户成功!“endl;k1=k1-1;return k1;/数据库显示函数,void xianshi(int num)int i,k;

8、k=num;message temp;fstream file;file.open (“xinxi.dat“,ios:in|ios:binary);file.seekg(0,ios:beg);cout“整个小型数据库中的数据如下所示:“endl;coutsetw(8)“账户“setw(8)“密码“setw(8)“余额“endl;for(i=0;ik;i+)file.seekg(i*sizeof(message),ios:beg);file.read(char*)if(temp.sign !=2)coutsetw(8)temp.name setw(8)temp.code setw(8)temp.cash endl;if(temp.sign =1)cout“(上一个账号已经被挂失,资金被冻结)“endl;file.close ();

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号