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. ...

Song- Khamoshiyan Piano keyboard Chord,Notation and songs Lyrics

Song Aankhen Khuli Ho lyrics notation

Song : Aankhen Khuli Ho Movie: Mohabbatein Notes used : W=>Western - C D E F G- A- B-/ H=>Hindustani - S R G M P- D- N- ( Here for western, G=G-, A=A-, & B=B- ) ( For hindustani, P=P-, D=D-, & N=N- ) Song I : Aankhen Khuli...Ho Ya.. Ho Bandh W=> A.... C... B..C.. E.. E...... A... A.... H=> D... S... N..S.. G G....... D... D.... Deedaar Un Ka Ho.o.taa Hai.. W=> A...B....A....D.BAG....ADB... H=> D...N...D.....R.NDP...DRN... Kaise Kahoon Main O..Yaaraa W=> B..D.. D....E.... D.....C..C..C... H=> N..R.. R....G... R.....S..S..S..... Ye Pyaar Kaise Hota Hai W=> E...B.....DB...AG...B..AA H=> G...N....RN...DP...N...DD (Tururu ru ru, ru ru rururu ru......) W=> AA...GA...BCE..., B...DB..GA H=> DD...PD...NSG..., N..RN.. PD Song II: Aa.aj He Kisi..par Yaa.ro.on..., Marke De..Khe..gein Hum W=> E....FEDCBABC.D.. D D......., G A B C.... E.......D...D..... H=> G....MGRSNDNS.R. R R......., P D N S.....G........R...R.... Pyaar Ho...