Skip to main content

Bank project example using c++

Bank project example using c++


 #include  
 #include"fstream.h"  
 using std::cout;  
 using std::cin;  
 class BankUser{  
 public:  
 BankUser();  
 void viewBalance();  
 void deposit();  
 void withdraw();  
 double transfer1();  
 void transfer2(double);  
 private:  
 double blance;  
 };  
 BankUser::BankUser()  
 {  
 char type;  
 cout<<"enter the type for this Account";  
 cout<<"\n\ncheck Account :C";  
 cout<<"\nSaving Account :S";  
 cout<<"\n\n\ Enter ur Choice :";  
 cin>>type;  
 if (type=='S'||type=='S')  
 blance=1500;  
 else  
 blance=1000;  
 }  
 void BankUser::viewBalance()  
 {  
 cout<<"\n The Current Blane Of This Account Is="<>amount;  
 blance+=amount;  
 if(blance>2000)  
 blance+=50;  
 viewBalance();  
 }  
 void BankUser::withdraw()  
 {  
 double amount;  
 cout<<"Enter the Amount to be with drawn :";  
 cin>>amount;  
 blance-=amount;  
 if(blance<500)  
 blance-=25;  
 viewBalance();  
 }  
 double BankUser::transfer1()  
 {  
 double amount;  
 cout<<"Enetr The Amount to be Transfered";  
 cin>>amount;  
 }  
 void BankUser::transfer2(double amount)  
 {  
 blance+=amount;  
 }  
 void welcome()  
 {  
 cout<<"\n\n\t\t\t ABC Bank";  
 cout<<"\n\n\t\t\t ABC State";  
 char menu()  
 {  
 char choice;  
 cout<<"\n\n\t View Blance : V";  
 cout<<"\n\t\tDopist :D";  
 cout<<"\n\t\t Withdraw :W";  
 cout<<"\n\t\t Transfer :T";  
 cout<<"\n\t\t EXIT :E";  
 cout<<"\n\t Enter THE Choise :";  
 cin>>choice;  
 if(choice<92)  
 choice+=32;  
 return choice;  
 }  
 //MAIN MENU.........  
 int main()  
 {  
 welcome();  
 BankUser bu[5];  
 char ch;  
 int accNo;  
 do  
 {  
 ch=menu();  
 if(ch=='E')  
 break;  
 double tamount;  
 cout<<"\n\t Enter the Account Number(1..5) : ";  
 cin>>accNo;  
 switch(ch)  
 {  
 case 'V':bu[accNo -1].viewBalance();  
 break;  
 case 'D':bu[accNo -1].deposit();  
 break;  
 case 'W':bu[accNo -1].withdraw();  
 break;  
 case 'T':tamount=bu[accNo -1].transfer1();  
 cout<<"\n\t Enter the amount Number to be transfered : ";  
 cin>>accNo;  
 bu[accNo -1].transfer2(tamount);  
 break;  
 default :cout<<"\n\t Enter invalid menu option";  
 cout<<"\n\t Enter the valid Option.";  
 }  
 }  
 while (ch !='E');  
 cout<<"\n\t\t";  
 system("pause");  
 return 0;  
 }  
 //When the user creates an account, save his personal in formation  
 //in the file using a structure as follows:-  
 struct uerdata  
 {  
 char name[100];  
 char addr[100];  
 char phnum[12];  
 char accountnum[25];  
 // add more  
 };  
 struct userdata ud;  
 //then save this data in the binary format as follows:-  
 FILE *fs;  
 fs=fopen("usredata.dat","rb+");  
 if(fs==NULL)  
 {  
 fs=fopen("userdata.dat,"wb+");  
 if(fs==NULL)  
 {  
 // report error  
 }  
 }  
 fseek(fs,0L,SEEK_END);  
 fwrite(ud,sizeof(ud),1,fs);  
 //to read the userdata,  
 fs=fopen("userdata","rb+");  
 if(fs==NULL)  
 {  
 // report error  
 }  

Popular posts from this blog

Resolved : Power BI Report connection error during execution

Getting Below Power BI Report connection error during execution . Error: Something went wrong Unable to connect to the data source undefined. Please try again later or contact support. If you contact support, please provide these details. Underlying error code: -2147467259 Table: Business Sector. Underlying error message: AnalysisServices: A connection cannot be made. Ensure that the server is running. DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259 Microsoft.Data.Mashup.ValueError.DataSourceKind: AnalysisServices Microsoft.Data.Mashup.ValueError.DataSourcePath: 10.10.10.60;T_CustomerMaster_ST Microsoft.Data.Mashup.ValueError.Reason: DataSource.Error Cluster URI: WABI-WEST-EUROPE-redirect.analysis.windows.net Activity ID: c72c4f12-8c27-475f-b576-a539dd81826a Request ID: dfb54166-c78f-4b40-779f-e8922a6687ad Time: 2019-09-26 10:03:29Z Solution: We found report connection not able to connect to SQL Analysis service so tried below option. Re

Song- Khamoshiyan Piano keyboard Chord,Notation and songs Lyrics

All songs notation and chords at one place

Song : O Saathi Re Film : Mukhathar Ka Sikkandhar Uses : C D D# E G A Note : The numbers at the end of the lines indicate line numbers. Pallavi: O saathi re, tere binaa bhi kya jina, tere binaa bhi kya jina A- C D D#....,D D C DD E...C..CA-...,D D C DD E...CC.......1 Play line 1 again phulon men khaliyon men sapnom ki galiyon men GGG...GAGE.. GGG G A G E.................................................2 tere bina kuchh kahin naa E A G E D C D D#.......................................................................3 tere binaa bhi kya jina, tere binaa bhi kya jina D D C DD E....C..CA-..., D D C DDE....CC.............................4 Charanam: har dhadkan men, pyaas hai teri, sanson men teri khushboo hai CCC C D C A-, CCC C D C A-, DDD DED CD EE.. CCCC......................5 is dharthi se, us ambar tak, meri nazar men tu hi tu hai CCC C D C A-, CCC C D C A-, DDD DED CD EE.. CCCC......................6 pyaar yeh tute naa GGG... GAG D#......E.........................