/
*copyright (c)2014,烟台大学计算机学院
*All rights reserved
*文件名称:qwe.cpp
*作者:孙春红
*完成日期:2014年11月18日
*版本号:v1.0
*
*问题描述:编写程序,打一个银行系统的基本框架。
*/
#include <iostream>
using namespace std;
const int password=123456;
int main()
{
int n,cinput,coutput,m,cchoice;
bool bExit=false;
cout << "INTERNATIONAL BANK 欢迎您!" << endl;
cout<<"请输入密码:";
cin>>n;
if (n!=password)
{
cout <<"输入错误,不要捉急!"<<endl;
}
else
{
do
{
cout <<"* 您可以办理下面业务:"<<endl;
cout <<"* 1.查询"<<endl;
cout <<"* 2.取款"<<endl;
cout <<"* 3.存款"<<endl;
cout <<"* 4.转账"<<endl;
cout <<"* 0.退出"<<endl;
cout <<"* 请输入(0-4):";
cin>>cchoice;
switch (cchoice)
{
case 1:
cout <<"您的余额还有****.**元。"<<endl;
break;
case 2:
cout <<" 请输入取款金额:";
cin >>coutput;
cout <<"谢谢使用!"<<endl;
break;
case 3:
cout <<"请输入存款金额:";
cin >>cinput;
cout <<"谢谢使用!"<<endl;
break;
case 4:
cout <<"请输入转账金额:";
cin >>m;
cout <<"谢谢使用!"<<endl;
break;
case 0:
cout <<"谢谢,欢迎下次再来!!"<<endl;
break;
default:
cout <<"输入错误,不要捉急!"<<endl;
bExit =true;
}
}while (!bExit);
return 0;
}
}
运行结果:
知识点总结:
运用多种知识编写银行系统基本框架,例如多种输入方式的处理,循环语句,switch语句。。。
学习心得:
不知道为什么运行结果会是这样,求大神支招!