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

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

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

PHP Tips-Getting the nodes list of xml doument with responseXml in ajax ,call image save in database,time difference etc

Getting the nodes list of xml doument with responseXml in ajax var obj = ""; function callAjaxObj() { try { obj = new XMLHttpRequest(); } catch(e) { try { obj = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { obj = ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("your browser doesn't support ajax"); return false; } } } } function testResponseXml() { callAjaxObj(); obj.open("get","sample.xml",true); obj.onreadystatechange=function() { if(obj.readyState==4) { var doc = obj.responseXML.documentElement; //var doc = obj.responseXML; alert(doc.getElementsByTagName('user').length); } } obj.send(null); } Example of calender script in PHP calender script in PHP echo " $title $year "; echo "SMTWTFS"; $day_count = 1; echo ""; while ( ...