password: 1122
_____________________________________________________
#include<iostream>
#include<conio.h>
#include<string>
#include <cstdlib>
#include<process.h>
using namespace std;
void intro()
{
char admn[20]={0};
int passw=0;
system("CLS");
cout<<"\n\n\n\n\n\t\t\tWelcome to Sharif Bank Limitted"<<endl;
cout<<"\n\n\n\tEnter Your name :"<<admn[20];cin.getline(admn,20);
cout<<"\n\n\n\tEnter your Password :";cin>>passw;
if (passw!=1122)
{
system("CLS");
cout<<"\n\n\n\n\n\tYou have enter wrong Password Please Try again";
getch();
system("CLS");
cout<<"\n\n\n\n\n\tWelcome to Sharif Bank Limitted"<<endl;
cout<<"\n\n\n\tThis is your Last try so be Careful";
cout<<"\n\n\n\tEnter your Password :";cin>>passw;
}
if (passw!=1122)
{
exit(0);
}
}
struct account
{
string name,name2;
int number;
int dep;
};
account ac1;
account ac2;
account ac3;
int write_account()
{
cout<<"\n\n\n\t\tEnter The Detail of First Account "<<endl<<endl;
cout<<"\n\n\tEnter the first name of the person :";
cin>>ac1.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac1.name2;
cout<<"\n\tEnter the account number of the person :";
cin>>ac1.number;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac1.dep;
system("CLS");
cout<<"\n\n\n\t\tEnter The Detail of Secound Account "<<endl<<endl;
cout<<"\n\tEnter the First name of the person :";
cin>>ac2.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac2.name2;
cout<<"\n\tEnter the account number of the person :";
cin>>ac2.number;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac2.dep;
system("CLS");
cout<<"\n\n\n\t\tEnter The Detail of Third Account "<<endl<<endl;
cout<<"\n\tEnter the First name of the person :";
cin>>ac3.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac3.name2;
cout<<"\n\tEnter the account number of the person :";
cin>>ac3.number;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac3.dep;
system("CLS");
}
int deposit()
{
int num,num2;
cout<<"\n\n\t\t Deposit Cash ";
cout<<"\n\n\n\tEnter The account Nunber of person : ";
cin>>num;
if(num==ac1.number)
{
cout<<"\n\tEnter The amount deposit in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac1.name<<" "<<ac1.name2;
cout<<"\n\tBelance in Account before Deposit : "<<ac1.dep;
ac1.dep=ac1.dep+num2;
cout<<"\n\tBelance in Account After Deposit : "<<ac1.dep;
getch ();
}else if(num==ac2.number)
{
cout<<"\n\tEnter The amount deposit in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac2.name<<" "<<ac2.name2;
cout<<"\n\tBelance in Account before Deposit : "<<ac2.dep;
ac2.dep=ac2.dep+num2;
cout<<"\n\tBelance in Account After Deposit : "<<ac2.dep;
getch ();
}else if(num==ac3.number)
{
cout<<"\n\tEnter The amount deposit in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac3.name<<" "<<ac3.name2;
cout<<"\n\tBelance in Account before Deposit : "<<ac3.dep;
ac3.dep=ac3.dep+num2;
cout<<"\n\tBelance in Account After Deposit : "<<ac3.dep;
getch ();
}else
{
system("CLS");
cout<<"\n\n\t The Acount number you have enter ";
cout<<"\n\t Does not Exist ";
cout<<"\n\n\t please Try Again ";
getch ();
}
}
int withdraw()
{
int num,num2;
cout<<"\n\n\t\t Withdraw Cash ";
cout<<"\n\n\n\tEnter The account Nunber of person : ";
cin>>num;
if(num==ac1.number)
{
cout<<"\n\tEnter The amount withdraw in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac1.name<<" "<<ac1.name2;
cout<<"\n\tBelance in Account before withdraw : "<<ac1.dep;
ac1.dep=ac1.dep-num2;
cout<<"\n\tBelance in Account After withdraw : "<<ac1.dep;
getch ();
}else
if(num==ac2.number)
{
cout<<"\n\tEnter The amount Withdraw in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac2.name<<" "<<ac2.name2;
cout<<"\n\tBelance in Account before Withdraw : "<<ac2.dep;
ac2.dep=ac2.dep-num2;
cout<<"\n\tBelance in Account After withdraw : "<<ac2.dep;
getch ();
}else if (num==ac3.number)
{
cout<<"\n\tEnter The amount withdraw in PKR : ";
cin>>num2;
cout<<"\n\tName of the person is :"<<ac3.name<<" "<<ac3.name2;
cout<<"\n\tBelance in Account before withdraw : "<<ac3.dep;
ac3.dep=ac3.dep-num2;
cout<<"\n\tBelance in Account After withdraw : "<<ac3.dep;
getch ();
}
else
{
system("CLS");
cout<<"\n\n\t The Acount number you have enter ";
cout<<"\n\t Does not Exist ";
cout<<"\n\n\t please Try Again ";
getch ();
}
}
int display()
{
int num;
cout<<"\n\n\t\t Balance Enquiry ";
cout<<"\n\n\n\tEnter The account Nunber of person : ";
cin>>num;
if(num==ac1.number)
{
cout<<"\n\n\tAcount number that you have enter :"<<ac1.number;
cout<<"\n\tName of the person is :"<<ac1.name<<" "<<ac1.name2;
cout<<"\n\tTotal Balance in the account is : "<<ac1.dep;
getch ();
}else if(num==ac2.number)
{
cout<<"\n\n\tAcount number that you have enter :"<<ac2.number;
cout<<"\n\tName of the person is :"<<ac2.name<<" "<<ac2.name2;
cout<<"\n\tTotal Balance in the account is : "<<ac2.dep;
getch ();
}else if(num==ac3.number)
{
cout<<"\n\n\tAcount number that you have enter :"<<ac3.number;
cout<<"\n\tName of the person is :"<<ac3.name<<" "<<ac3.name2;
cout<<"\n\tTotal Balance in the account is : "<<ac3.dep;
getch ();
}else
{
system("CLS");
cout<<"\n\n\t The Acount number you have enter ";
cout<<"\n\t Does not Exist ";
cout<<"\n\n\t please Try Again ";
getch ();
}
}
int display_all()
{
cout<<"\n\n\t\t All Account holder List ";
if(ac1.number!=-100000)
{
cout<<"\n\n\n\tName of the first account holdder : "<<ac1.name<<" "<<ac1.name2;
}else
{
cout<<"\n\n\n\tThe First account has been Closed.............";
}
if(ac2.number!=-100000)
{
cout<<"\n\n\n\tName of the Second account holdder : "<<ac2.name<<" "<<ac2.name2;
}else
{
cout<<"\n\n\n\tThe Secound account has been Closed............ ";
}
if(ac3.number!=-100000)
{
cout<<"\n\n\n\tName of the Third account holdder : "<<ac3.name<<" "<<ac3.name2;
}else
{
cout<<"\n\n\n\tThe Third account has been Closed............. ";
}
getch ();
}
int delet_account()
{
int num;
cout<<"\n\n\t\t Close Account ";
cout<<"\n\n\n\tEnter The Number of the account that youy want to Closed : ";
cin>>num;
if(num==ac1.number)
{
ac1.number=-100000;
}else if(num==ac2.number)
{
ac2.number=-100000;
}else if(num==ac3.number)
{
ac3.number=-100000;
}else
{
system("CLS");
cout<<"\n\n\t The Acount number you have enter ";
cout<<"\n\t Does not Exist ";
cout<<"\n\n\t please Try Again ";
getch ();
}
}
int modify_account()
{
int num;
cout<<"\n\n\t\t Modify the Account ";
cout<<"\n\n\n\tEnter The Account Nunber of person : ";
cin>>num;
if(num==ac1.number && ac1.number!=-100000)
{
cout<<"\n\tEnter the first name of the person :";
cin>>ac1.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac1.name2;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac1.dep;
system("CLS");
cout<<"\n\n\t Account has been Modified press any key to continue............. ";
getch ();
}else if(num==ac2.number && ac2.number!=-100000)
{
cout<<"\n\tEnter the first name of the person :";
cin>>ac2.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac2.name2;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac2.dep;
system("CLS");
cout<<"\n\n\t Account has been Modified press any key to continue............. ";
getch ();
}else if(num==ac3.number && ac3.number!=-100000)
{
cout<<"\n\tEnter the first name of the person :";
cin>>ac3.name;
cout<<"\n\tEnter the Last name of the person :";
cin>>ac3.name2;
cout<<"\n\tEnter the Blance or Amount to be Deposit :";
cin>>ac3.dep;
system("CLS");
cout<<"\n\n\t Account has been Modified press any key to continue............. ";
getch ();
}else
{
system("CLS");
cout<<"\n\n\t The Acount number you have enter ";
cout<<"\n\t Does not Exist ";
cout<<"\n\n\t please Try Again ";
getch ();
}
}
int main()
{
int s=0;
intro();
do
{
system("CLS");
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. NEW ACCOUNT";
cout<<"\n\n\t02. DEPOSIT AMOUNT";
cout<<"\n\n\t03. WITHDRAW AMOUNT";
cout<<"\n\n\t04. BALANCE ENQUIRY";
cout<<"\n\n\t05. ALL ACCOUNT HOLDER LIST";
cout<<"\n\n\t06. CLOSE AN ACCOUNT";
cout<<"\n\n\t07. MODIFY AN ACCOUNT";
cout<<"\n\n\t08. EXIT";
cout<<"\n\n\tSelect Your Option (1-8) ";
cin>>s;
system("cls");
if(s==1)
{
write_account();
}else if(s==2)
{
deposit();
}
else if(s==3)
{
withdraw();
}else if(s==4)
{
display();
}else if(s==5)
{
display_all();
}else if(s==6)
{
delet_account();
}else if(s==7)
{
modify_account();
}else if(s==8)
{
cout<<"\n\n\tThanks for using bank managemnt system";
}else
{
cout<<"\n\n\tYou have enter wrong key";
getch();
}
}while(s!=8);
getch ();
return 0;
}
No comments:
Post a Comment