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

📄 banking.cpp

📁 这是一家银行系统展示程序
💻 CPP
字号:
//programmed by kallol chakraborty
//for any advise log on to my email account:chak.kallol@gmail.com
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<dos.h>
#include<math.h>
int e;
float g,f,l;
static int coun,count=0;

class person
{       //static int count;
	char name[100],add[100];
	char branch[100],city[100];
	float age,amt;
	int an;
	clock_t start, end;
	public:
	void getdetails();
	void deposit();
	void withdraw();
	void details();
	//int time();
	void interest();
};
	/*int person::time()
	{

	start = clock();

	delay(200);

	end = clock();

	g=(end - start) / CLK_TCK;

	return g;
	}*/
	void person::interest()
	{
	   cout<<"\t\t\t\Enter the Account number\n";
	   int c;
	   cin>>c;
	   if(c==an)
	   {    cout<<"enter the rate of interst"<<endl;
		cin>>l;
		f=((amt*l)/100);
		amt=amt+f;

		cout<<"\t\t\tName :"<<name<<endl;
		cout<<"\t\t\tAddress :"<<add<<endl;
		cout<<"\t\t\tBranch :"<<branch<<endl;
		cout<<"\t\t\tcity :"<<city<<endl;
		cout<<"\t\t\tAccount number :"<<an<<endl;
		//cout<<"\t\t\tTotal Amount :"<<amt<<endl;
		cout<<"total amount in the account is :"<<amt<<endl;

	   }
	}
	  // int person::count=0;
       /*	void person :: getdetails()
	{
		clrscr();
		cout<<"\t\t\tWelcome to MY Bank"<<endl;
		cout<<"\t\t\t---------------------"<<endl;
		cout<<"\t\t\tEnter the Name of the Account Holder"<<endl;
		cin>>name;

		cout<<"\t\t\tEnter the Age of the Account Holder"<<endl;
		cin>>age;
		cout<<"\t\t\tEnter the Branch of the Account Holder"<<endl;
		cin>>branch;
		cout<<"Enter the Address of the Account Holder"<<endl;
		cin>>add;
		cout<<"\t\t\tEnter the City of the Account Holder"<<endl;
		cin>>city;
		coun=++count;
		cout<<"\t\t\tyour account number is :"<<coun;
		cout<<"\t\t\tThank You!"<<endl;
	}*/


	void person::deposit()
	{
		cout<<"Enter the Name of the Account Holder"<<endl;
		cin>>name;
		cout<<"Enter the Amount to be deposited"<<endl;
		cin>>amt;
		cout<<"Enter the Address of the Account Holder"<<endl;
		cin>>add;
		cout<<"Enter the Branch Name"<<endl;
		cin>>branch;

		cout<<"Enter the City Name"<<endl;
		cin>>city;
		coun=++count;
		cout<<"Your Account number is :"<<coun<<endl;
		cout<<"Enter the Account Number for Verification\n";
		cin>>an;
		/*if(coun|=an)
		{
			cout<<"enter the account no properly"<<endl;
		}
		else */
		cout<<"Thank You!"<<endl;
	}

	void person::withdraw()
	{
		clrscr();
		//cout<<"Enter the Name of the Account Holder"<<endl;
		//cin>>name;

		//for(int i=0;i<2;i++)
		//{
			cout<<"Enter the Account number of the Account Holder"<<endl;
			int n;
			cin>>n;
			if(n==an)
		{

			cout<<"\t\t\tName :"<<name<<endl;
			cout<<"\t\t\tAddress :"<<add<<endl;
			cout<<"\t\t\tBranch :"<<branch<<endl;
			cout<<"\t\t\tcity :"<<city<<endl;
			cout<<"\t\t\tAccount number :"<<n<<endl;
			cout<<"Total Amount :"<<amt<<endl;
			cout<<"Enter the Amount to be Withdrawn"<<endl;
			float c;
			cin>>c;
			{
			if(c>amt)
			{
				cout<<"Insufficient Balance"<<endl;
				cout<<"Sorry !"<<endl;
			}
			else
			{
				float b;
				b=amt-c ;
				cout<<"Balanced Amount :Rs "<<b<<endl ;
				amt=b;
			}
			}
		}
		else
		{
			cout<<"Enter the Account Number Properly"<<endl;
		//}
			cout<<"Sorry !";
		}
		//break;
	}

	void person::details()
	{
		clrscr();
	       //	for(int i=0;i<2;i++)
		//{

			cout<<"Enter the Account number of the Account Holder"<<endl;
			float n;
			cin>>n;
			if(n==an)
			{
				clrscr();
				cout<<"\t\t\tName :"<<name<<endl;
				cout<<"\t\t\tAddress :"<<add<<endl;
				cout<<"\t\t\tBranch :"<<branch<<endl;
				cout<<"\t\t\tcity :"<<city<<endl;
				cout<<"\t\t\tAccount number :"<<n<<endl;
				cout<<"\t\t\tTotal Amount :"<<amt<<endl;
			}
			else
			{
			cout<<"Enter the Account number properly"<<endl;
		//}
			cout<<"Sorry !";
			}
			//break;
		}

	void main()
	{
	person p;
	do
	{
		cout<<"\t\t\tWelcome to MY bank"<<endl;
		cout<<"\t\t\t--------------------"<<endl;
		cout<<"\t\t\t********MENU********"<<endl;
		//cout<<"\t\t\tPress 1 for Entering Account holder's Details"<<endl;
		cout<<"\t\t\tPress 1 for Depositing Money"<<endl;
		cout<<"\t\t\tPress 2 for Withdrawing money"<<endl;
		cout<<"\t\t\tPress 3 for Viewing Details without interest"<<endl;
		cout<<"\t\t\tPress 5 for Viewing the total amount with interest"<<endl;
		cout<<"\t\t\tEnter 0 for Exit"<<endl;
		cout<<"\t\t\tEnter your choice\t";
	       //	int e;
		cin>>e;
		switch(e)
		{
			//case 1:clrscr();
				//p.getdetails();
				//break;
			case 1:clrscr();
				p.deposit();
				break;
			case 2:clrscr();
				p.withdraw();
				//p.details();
				break;
			case 3:p.details();
				break;
			case 5:p.interest();
				break;
			case 0:break;
		default:cout<<"Enter the Correct Choice"<<endl;
		}
	}while(e);
}

⌨️ 快捷键说明

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