1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | #include<iostream.h> #include<conio.h> int flag=0; int dep=0; int wid=0; int balance=0; class bank { public: void deposit() { display(); cout<<"ENTER AMOUNT\n"; cin>>dep; balance=balance+dep; display(); } void widraw() { display(); if(balance>500) { cout<<"ENTER AMOUNT TO WIDRAW\n"; cin>>wid; } else { cout<<"\nACCCOUNT BALANCE IS LOW! "<<balance<<"\n"; } if(balance>wid) { if(balance-wid>=500) balance=(balance-wid); display(); } else { cout<<"TRANSACTION CANNOT PROCCEED INSUFFICIANT BALANCE\n"; display(); } } void display() { cout<<"CURRENT BALANCE: "<<balance<<"\n"; } }; void main() { if(flag==0) { clrscr(); } flag=1; bank s; int ch; cout<<"\n1:DEPOSIT\n2:WIDRAW\n3:SHOW BALANCE\n"; cin>>ch; switch(ch) { case 1 : s.deposit(); main(); break; case 2 : s.widraw(); main(); break; case 3 : s.display(); main(); break; } getch(); } |
Search This Blog
Thursday, 28 November 2013
PROGRAMM FOR BANKING OPERATTION DEPOSIT , WIDRWA AND SHOW CURENT BALANCE.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment