⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 银行管理系统源代码.txt

📁 实现银行管理系统的一些基本功能:开户、销户、存款、取款
💻 TXT
📖 第 1 页 / 共 2 页
字号:
#include <iostream.h>
#include <string.h>
#include   <stdlib.h>   
#include   <time.h> 
#include <windows.h>

//为方便使用,使用 宏。。。。用的不好~!~

#define OD 2000  //透支额OVERDRAFT
#define CD 30/100  //信用度creditdegree
#define M 50  //可存储的帐户最多个数

void face(int n)
{
	char * string[]={"",
	               "\t┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓",
	               "\t┃         ┏┯┓┏┯┓┏┯┓┏┯┓┏┯┓┏┯┓┏┯┓           ┃",
				   "\t┃         ┠数┨┠据┨┠结┨┠构┨┠双┨┠语┨┠班┨           ┃",
				   "\t┃         ┗┷┛┗┷┛┗┷┛┗┷┛┗┷┛┗┷┛┗┷┛           ┃",
	               "\t┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫",
				   "\t┃                      银行管理系统                            ┃",
				   "\t┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫",
				   "\t┃                                                              ┃",
	               "\t┃              操作方法:(请输入以下数字进行!)                  ┃",
				   "\t┃                                                              ┃",
			       "\t┃  -----------------欢迎进入nsy(新天空)银行管理系统----------  ┃",
				   "\t┃                                                              ┃",
				   "\t┃                     A、存折用户                              ┃",
				   "\t┃                                                              ┃",
				   "\t┃                     B、信用卡用户                            ┃",
				   "\t┃                                                              ┃",
			       "\t┃                     0、退出系统                              ┃",
				   "\t┃                                                              ┃",	
				   "\t┃                                                              ┃",	
				   "\t┃                                                              ┃",	
				   "\t┃                                                              ┃",	
				   "\t┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫",
				   "\t┃       OO════∩════OO                             ┃",
				   "\t┃             ╭╬╮          ◢                  ┃",
				   "\t┃       .▁╭▅▆▇□□█▇▆▅▄▃▂▁(╳)█╮               ┃",
				   "\t┃        ╰═▃_汽院电系▁∠════▔▔▔                   ┃",
				   "\t┃      *:-.,,.-:*``*:-.,,.-:*``*:-.,,.-:*``*:-.,,.-:*,,        ┃",
				   "\t┃    ╭╧╮╭╧╮╭╧╮╭╧╮╭╧╮ *:-.,,.-:*,、☆*:-.,:     ┃",
				   "\t┃     ║双║║语║║班║║天║║地║    ★*:-.,             ┃",
				   "\t┃     └﹏┘└﹏┘└﹏┘└﹏┘└﹏┘                    ┃",
				   "\t┃            程序设计:银行模拟系统	作者:王旭君	          ┃",
				   "\t┃            指导老师:马春江                                   ┃",
                   "\t┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"}; 
     if(n>=0)
	 {
		  for(int i=34;i>0;i--)
		  {
			  system("cls");
			  for(int j=i;j<34;j++)
				  cout<<string[j]<<endl;
			  Sleep(n);
		  }
	 }
     else
	 {
		  system("cls");
		  for(int i=0;i<34;i++)
			  cout<<string[i]<<endl;

	 }
  
}  
/**void show1(void)
{  
    cout<<"\n☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆";
 cout<<"\n           -----------------欢迎进入nsy银行管理系统----------"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                A、存折用户                    ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                B、信用卡用户                  ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           --------------------------------------------------"<<endl;
 cout<<"☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆\n\n";
 cout<<"      请选择你的卡类型:";
 }
**/
void show2(void)
{
    cout<<"\n☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆";
 cout<<"           ---------------------------------------------------"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                1、新开账户                    ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                2、已有账号                    ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                0、回到上一级菜单              ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           --------------------------------------------------"<<endl;
 cout<<"☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆"<<endl<<endl;
 cout<<"      请选择操作:";

}
void show3(void)
{
    cout<<"\n☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆";
 cout<<"           -------------------------------------------------"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           ||                1、查询余额                    ||"<<endl;
 cout<<"           ||                2、取款                        ||"<<endl;
 cout<<"           ||                3、存款                        ||"<<endl;
 cout<<"           ||                4、修改密码                    ||"<<endl;
 cout<<"           ||                5、删除用户                    ||"<<endl;
 cout<<"           ||                0、回到上一级菜单              ||"<<endl;
 cout<<"           ||                                               ||"<<endl;
 cout<<"           --------------------------------------------------"<<endl;
 cout<<"☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆\n\n";
 cout<<"      请选择操作:";
}

// 以下为程序正式开始部分
int t=1;		//记录银行户数目:存折和信用卡均算
int q=1;
int h;

class BankCard     //定义存折类
{
public:
   unsigned long   password;						 //密码
   double   balance;							     //余额
   unsigned long   cardnumber;					     //卡号
   BankCard(){}								         //构造函数
   void newcard();							         //新开帐户
   double getmoney();						         //银行卡取款
   double inmoney();                                 //存款
   double findbalance();                              //查询余额
   unsigned long changepw(unsigned long x);           //修改密码
   void dele(int x,unsigned long y,double z);         //删除存折用户
};BankCard B[M];


 //定义信用卡类

class CreditCard:public BankCard        
{
public:
      double findbalance2();       //信用卡查询余额
      void newcard2();             //信用卡新开帐户
	  double getmoney2();          //信用卡取款
	  void dele2(int x,unsigned long y,double z);         //删除信用卡用户
};CreditCard C[M];
 
double BankCard::getmoney()//存折取款
{
  double l;
     cout<<"    -----------------取款操作-------------------\n";
lab4:cout<<"\n    请输入要取的款额:";
     cin>>l;
  if(l>balance)
  {
   cout<<"     对不起,你的余额不足,请重新输入:"; goto lab4;
  }
     balance=balance-l;
     cout<<"    操作成功,谢谢使用!!\n    按任意键+enter或者0返回:  ";
  return balance;
} 

double CreditCard::getmoney2()//信用卡取款
{
  double l;
     cout<<"    -----------------取款操作-------------------\n";
lab4:cout<<"    \n请输入要取的款额:";
     cin>>l;
  if(l>(OD*CD+balance))
  {
   cout<<"    对不起,你的余额不足,请重新输入:"; goto lab4;
  }
     balance=balance-l;
     cout<<"     操作成功,谢谢使用!!\n    按任意键+enter或者0返回:  ";
  return balance;
} 

double BankCard::inmoney()               //存款
     {
              double l;
                 cout<<"     -----------------存款操作-------------------\n";
                 cout<<"\n    请输入要存的款额:";
                 cin>>l;
                 balance=balance+l;
     return balance;
     }
 
double BankCard::findbalance()             //存折查询余额
{ 
 cout<<"     -----------------存折查询余额操作-------------------\n"<<endl;   
 cout<<"     您的余额是: "<<balance<<endl;
 cout<<"     操作成功,谢谢使用!!\n    按任意键+enter或者0返回:  ";return balance;
 
}

double CreditCard::findbalance2()         //信用卡查询余额
{ 
 double m=OD*CD+balance;
 cout<<"    -----------------信用卡查询余额操作-------------------\n"<<endl;   
 cout<<"    信用卡查询余额:\n您的余额是: "<<balance+OD<<"\n其中可取款额为: "<<m<<endl;
 cout<<"    操作成功,谢谢使用!!\n    按任意键+enter或者0返回:  ";return balance;
}

void BankCard::newcard()   //存折新开帐户
{  
 unsigned long x,y,y1,y2;int k=1;
    double z; 
//x=Random[1000000001,999999999] ;
x=6465987613+(5+q)*t;

Paw1:	do 
 { 
  cout<<"    ------------新开存折帐户--------------------\n";
  cout<<"\n    请输入一个6位数字组成的密码:";
  cin>>y1;
    	  if(y1<99999)
	  {
		  cout<<"wrong!!! "<<endl;
		  goto Paw1;
	  }
        cout<<"    请再次输入密码:";
        cin>>y2;
        if(y1==y2) {y=y1;k=1;}
        else
  {  cout<<"    两次输入的密码不相同,请再次输入。\n";k=0;}
 } while(k==0);
 cout<<"    请输入开户金额: ";cin>>z; 
    cout<<"    请存入现金\n    处理中,请稍后………………\n"<<"     您新开的卡号是: "<<x<<"    请牢记!!";
    B[t].cardnumber=x;
 B[t].password=y;
 B[t].balance=z; t++;
    cout<<"\n    操作成功,谢谢使用!!\n    按任意键+enter或者0返回:  ";
}

void CreditCard::newcard2()   //信用卡新开帐户
{
 unsigned long x,y,y1,y2; int k=1;
    double z;  
 x=5496987613+(5+q)*t;
Paw:   do 
 { 
  cout<<"    ------------新开信用卡帐户--------------------\n";
  cout<<"\n    请输入一个6位数字组成的密码:";
  cin>>y1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -