银行系统
来源:互联网 发布:朝鲜留学 知乎 编辑:程序博客网 时间:2024/04/28 01:11
[cpp] view plaincopyprint?01.#include <iostream> 02.#include <cmath> 03.const password=123456; 04.using namespace std; 05.bool pass(); 06.void showbalance(); 07.void work(); 08.void zz(); 09.void qk(); 10.void ck(); 11.double huankuan() ; 12.void chioce(); 13.int main() 14.{ 15. cout<<'\t'<<'\t'<<'\t'<<'\t'<<" 王氏银行欢迎您! "<<endl; 16. if(pass()==true) 17. { 18. work(); 19. } 20. else 21. { 22. cout<<"请到柜台办理密码业务再来使用! 谢谢! "<<endl; 23. } 24. return 0; 25.} 26.bool pass() 27.{ 28. int i=1,pass; 29. bool k=false; 30. do{ 31. cout<<"请输入密码:"<<endl; 32. cin>>pass; 33. i++; 34. if(pass==password){ 35. k=true; 36. } 37. else 38. { k=false; 39. continue; 40. } 41. if(k) 42. return true; 43. else 44. return false; 45. }while(i<4); 46. 47.} 48.void chioce() 49.{ 50. cout<<"***请您选择服务内容:"<<endl; 51. int i; 52. char cChioce; 53. void chaxun(); 54. void qukuan(); 55. void cunkuan(); 56. void zhuanzhang(); 57. cout<<"* 1. 查询"<<endl; 58. cout<<"* 2. 取款"<<endl; 59. cout<<"* 3. 存款"<<endl; 60. cout<<"* 4. 转账"<<endl; 61. cout<<"* 5. 还款"<<endl; 62. cout<<"* 0. 退出"<<endl; 63. cout<<"* 请选择(0-5):"; 64. cin>>cChioce; 65. if (cChioce=='1') 66. showbalance(); 67. else if (cChioce=='2') 68. qk(); 69. else if (cChioce=='3') 70. ck(); 71. else if (cChioce=='4') 72. zz(); 73. else if (cChioce=='5') 74. huankuan(); 75. else if (cChioce=='0') 76. { 77. cout<<endl<<endl; 78. cout<<"***"<<"欢迎您下次光临!"<<endl<<endl; 79. } 80. 81. 82.} 83.void showbalance() 84.{ 85. cout<<"您的余额是9999999999元 。"<<endl; 86.} 87.void work() 88.{ 89. chioce(); 90.} 91. 92.double huankuan() 93.{ 94.double principal,rate,payPerYear,numYears,e,b,denom,payment,number; 95.cout<<"请输入本金:"; 96.cin>>principal; 97.cout<<"请输入当前利率:"; 98.cin>>rate; 99. cout<<"请输入还款年限:"; 100. cin>>numYears; 101. cout<<"请输入每年偿还贷款的次数:"; 102. cin>>payPerYear; 103. number=rate*principal/payPerYear; 104.e=-(payPerYear*numYears); 105.b=(rate/payPerYear)+1; 106.denom=1-pow(b,e); 107.payment=number/denom; 108.cout<<"Payment is :"<<payment<<endl; 109.return 0; 110.} 111. 112.void zz() 113.{ 114. int numb,money; 115. cout<<"请输入转账的银行卡卡号:"<<endl; 116. cin>>numb; 117. cout<<"请输入转款额度:"<<endl; 118. cin>>money; 119. cout<<"由于操作错误,你的资金将被扣留!"<<endl; 120.} 121.void ck() 122.{ 123. int my; 124. cout<<"请输入存款额度:"<<endl; 125. cin>>my; 126. cout<<"由于机器故障,你的现金已经被吞没,请自认倒霉!"<<endl; 127.} 128.void qk() 129.{ 130. int money; 131. cout<<"请输入取款金额:"<<endl; 132. cin>>money; 133. cout<<"请验钞,谢谢使用!"<<endl; 134.} #include <iostream>#include <cmath>const password=123456;using namespace std;bool pass();void showbalance();void work();void zz();void qk();void ck();double huankuan() ;void chioce();int main(){ cout<<'\t'<<'\t'<<'\t'<<'\t'<<" 王氏银行欢迎您! "<<endl;if(pass()==true){work();}else{cout<<"请到柜台办理密码业务再来使用! 谢谢! "<<endl;} return 0;}bool pass(){ int i=1,pass;bool k=false; do{ cout<<"请输入密码:"<<endl; cin>>pass; i++; if(pass==password){ k=true; } else{k=false; continue;} if(k) return true; else return false; }while(i<4); }void chioce(){ cout<<"***请您选择服务内容:"<<endl; int i; char cChioce; void chaxun(); void qukuan(); void cunkuan(); void zhuanzhang();cout<<"* 1. 查询"<<endl;cout<<"* 2. 取款"<<endl;cout<<"* 3. 存款"<<endl;cout<<"* 4. 转账"<<endl;cout<<"* 5. 还款"<<endl;cout<<"* 0. 退出"<<endl;cout<<"* 请选择(0-5):";cin>>cChioce;if (cChioce=='1')showbalance();else if (cChioce=='2') qk();else if (cChioce=='3') ck(); else if (cChioce=='4') zz();else if (cChioce=='5') huankuan();else if (cChioce=='0'){ cout<<endl<<endl;cout<<"***"<<"欢迎您下次光临!"<<endl<<endl;}}void showbalance(){cout<<"您的余额是9999999999元 。"<<endl;}void work(){chioce();}double huankuan() { double principal,rate,payPerYear,numYears,e,b,denom,payment,number; cout<<"请输入本金:"; cin>>principal; cout<<"请输入当前利率:"; cin>>rate; cout<<"请输入还款年限:"; cin>>numYears; cout<<"请输入每年偿还贷款的次数:"; cin>>payPerYear; number=rate*principal/payPerYear; e=-(payPerYear*numYears); b=(rate/payPerYear)+1; denom=1-pow(b,e); payment=number/denom; cout<<"Payment is :"<<payment<<endl; return 0; } void zz(){int numb,money;cout<<"请输入转账的银行卡卡号:"<<endl;cin>>numb;cout<<"请输入转款额度:"<<endl;cin>>money;cout<<"由于操作错误,你的资金将被扣留!"<<endl;}void ck(){int my;cout<<"请输入存款额度:"<<endl;cin>>my;cout<<"由于机器故障,你的现金已经被吞没,请自认倒霉!"<<endl;}void qk(){ int money;cout<<"请输入取款金额:"<<endl;cin>>money;cout<<"请验钞,谢谢使用!"<<endl;}[cpp] view plaincopyprint?01.#include <iostream> 02.#include <cmath> 03.const password=123456; 04.using namespace std; 05.bool pass(); 06.void showbalance(); 07.void work(); 08.void zz(); 09.void qk(); 10.void ck(); 11.double huankuan() ; 12.void chioce(); 13.int main() 14.{ 15. cout<<'\t'<<'\t'<<'\t'<<'\t'<<" 王氏银行欢迎您! "<<endl; 16. if(pass()==true) 17. { 18. work(); 19. } 20. else 21. { 22. cout<<"请到柜台办理密码业务再来使用! 谢谢! "<<endl; 23. } 24. return 0; 25.} 26.bool pass() 27.{ 28. int i=1,pass; 29. bool k=false; 30. do{ 31. cout<<"请输入密码:"<<endl; 32. cin>>pass; 33. i++; 34. if(pass==password){ 35. k=true; 36. } 37. else 38. { k=false; 39. continue; 40. } 41. if(k) 42. return true; 43. else 44. return false; 45. }while(i<4); 46. 47.} 48.void chioce() 49.{ 50. cout<<"***请您选择服务内容:"<<endl; 51. int i; 52. char cChioce; 53. void chaxun(); 54. void qukuan(); 55. void cunkuan(); 56. void zhuanzhang(); 57. cout<<"* 1. 查询"<<endl; 58. cout<<"* 2. 取款"<<endl; 59. cout<<"* 3. 存款"<<endl; 60. cout<<"* 4. 转账"<<endl; 61. cout<<"* 5. 还款"<<endl; 62. cout<<"* 0. 退出"<<endl; 63. cout<<"* 请选择(0-5):"; 64. cin>>cChioce; 65. if (cChioce=='1') 66. showbalance(); 67. else if (cChioce=='2') 68. qk(); 69. else if (cChioce=='3') 70. ck(); 71. else if (cChioce=='4') 72. zz(); 73. else if (cChioce=='5') 74. huankuan(); 75. else if (cChioce=='0') 76. { 77. cout<<endl<<endl; 78. cout<<"***"<<"欢迎您下次光临!"<<endl<<endl; 79. } 80. 81. 82.} 83.void showbalance() 84.{ 85. cout<<"您的余额是9999999999元 。"<<endl; 86.} 87.void work() 88.{ 89. chioce(); 90.} 91. 92.double huankuan() 93.{ 94.double principal,rate,payPerYear,numYears,e,b,denom,payment,number; 95.cout<<"请输入本金:"; 96.cin>>principal; 97.cout<<"请输入当前利率:"; 98.cin>>rate; 99. cout<<"请输入还款年限:"; 100. cin>>numYears; 101. cout<<"请输入每年偿还贷款的次数:"; 102. cin>>payPerYear; 103. number=rate*principal/payPerYear; 104.e=-(payPerYear*numYears); 105.b=(rate/payPerYear)+1; 106.denom=1-pow(b,e); 107.payment=number/denom; 108.cout<<"Payment is :"<<payment<<endl; 109.return 0; 110.} 111. 112.void zz() 113.{ 114. int numb,money; 115. cout<<"请输入转账的银行卡卡号:"<<endl; 116. cin>>numb; 117. cout<<"请输入转款额度:"<<endl; 118. cin>>money; 119. cout<<"由于操作错误,你的资金将被扣留!"<<endl; 120.} 121.void ck() 122.{ 123. int my; 124. cout<<"请输入存款额度:"<<endl; 125. cin>>my; 126. cout<<"由于机器故障,你的现金已经被吞没,请自认倒霉!"<<endl; 127.} 128.void qk() 129.{ 130. int money; 131. cout<<"请输入取款金额:"<<endl; 132. cin>>money; 133. cout<<"请验钞,谢谢使用!"<<endl; 134.} #include <iostream>#include <cmath>const password=123456;using namespace std;bool pass();void showbalance();void work();void zz();void qk();void ck();double huankuan() ;void chioce();int main(){ cout<<'\t'<<'\t'<<'\t'<<'\t'<<" 王氏银行欢迎您! "<<endl;if(pass()==true){work();}else{cout<<"请到柜台办理密码业务再来使用! 谢谢! "<<endl;} return 0;}bool pass(){ int i=1,pass;bool k=false; do{ cout<<"请输入密码:"<<endl; cin>>pass; i++; if(pass==password){ k=true; } else{k=false; continue;} if(k) return true; else return false; }while(i<4); }void chioce(){ cout<<"***请您选择服务内容:"<<endl; int i; char cChioce; void chaxun(); void qukuan(); void cunkuan(); void zhuanzhang();cout<<"* 1. 查询"<<endl;cout<<"* 2. 取款"<<endl;cout<<"* 3. 存款"<<endl;cout<<"* 4. 转账"<<endl;cout<<"* 5. 还款"<<endl;cout<<"* 0. 退出"<<endl;cout<<"* 请选择(0-5):";cin>>cChioce;if (cChioce=='1')showbalance();else if (cChioce=='2') qk();else if (cChioce=='3') ck(); else if (cChioce=='4') zz();else if (cChioce=='5') huankuan();else if (cChioce=='0'){ cout<<endl<<endl;cout<<"***"<<"欢迎您下次光临!"<<endl<<endl;}}void showbalance(){cout<<"您的余额是9999999999元 。"<<endl;}void work(){chioce();}double huankuan() { double principal,rate,payPerYear,numYears,e,b,denom,payment,number; cout<<"请输入本金:"; cin>>principal; cout<<"请输入当前利率:"; cin>>rate; cout<<"请输入还款年限:"; cin>>numYears; cout<<"请输入每年偿还贷款的次数:"; cin>>payPerYear; number=rate*principal/payPerYear; e=-(payPerYear*numYears); b=(rate/payPerYear)+1; denom=1-pow(b,e); payment=number/denom; cout<<"Payment is :"<<payment<<endl; return 0; } void zz(){int numb,money;cout<<"请输入转账的银行卡卡号:"<<endl;cin>>numb;cout<<"请输入转款额度:"<<endl;cin>>money;cout<<"由于操作错误,你的资金将被扣留!"<<endl;}void ck(){int my;cout<<"请输入存款额度:"<<endl;cin>>my;cout<<"由于机器故障,你的现金已经被吞没,请自认倒霉!"<<endl;}void qk(){ int money;cout<<"请输入取款金额:"<<endl;cin>>money;cout<<"请验钞,谢谢使用!"<<endl;}