Bank

#include <iostream> class Bank_Account { private: char pname[20]; unsigned int acnum; char actype [10] ; float ac_bal; public

: Bank_Account() {acc_bal = 0.00; } // constructor void get_data() ; void deposit() ; void withdraw(); void showdata() ; }; void Bank_Account :: get_data() { cout << "\nEnter your name: ";<<endl ; cin >> pname; cout<<"Enter the account type : "<<endl ; cin>>actype; cout << "\nEnter current account balance: "<<endl; cin >> ac_bal; } void Bank_Account::deposit() { int acnum; float dep; cout<<" Enter the Account number : "; cin>>acnum; if(acnum!=actype) { cout<<"Opps! Have u entered wrong account number :"; } else { cout << "\nEnter amount to be deposited: "; cin >> dep; acc_bal += dep; } } void Bank_Account::withdraw() { float wdraw;

". "\t\n" << "3 . "\t\n" << "1 . Bank_Account bk[10].". int recnum.\n\n". cin>>choice. } cout << "\nEnter amount to be withdrawn: ". "\t\n" << "4 . cout<<"\n Account type "<<actype.0f) { cout <<"U cannot withdraw a money from ur acoount".Deposit money. cin >> wdraw. . "\t\n" << "2 .Quit Application.".Add a customer.if(acnum!=actype) { cout<<"Opps! Have u entered wrong account number :". do { cout cout cout cout cout cout cout << << << << << << << "\t\t\n\n" << "Main Menu". } int main() { int choice. "\t\n" << "5 . int count = 0.Show Account Information.". cout << "\nAccount Balance: " << acc_bal << endl. "\t" << "Choice: ".Withdraw money. } } } void Bank_Account :: show_data() { cout << "Name: " << pname. else { acc_bal -= wdraw. } else { if(acc_bal == 1000. cout << "\nAccount number: " << acnum.

showdata(). cin >> recnum. system("cls"). case 3: system("cls"). Press any key to return to ma in menu. /* cout << "\nEnter customer number: ". system("cls"). system("cls").withdraw().switch(choice) { case 1: system("cls").". break. } }while(choice!=5).deposit(). bk[count]. break. cin >> recnum. return 0.". case 2: system("cls"). case 5: exit (EXIT_FAILURE). bk[count]. default: cout << "\nInvalid selection. */ bk[count]. break. break.*/ bk[count].getdata(). } count += 1. if (count > 10) { cout << "Can't add anymore records. break. } . system("cls"). Press a key to return to main menu. /* cout << "\nEnter customer number: ". case 4: system("cls"). break.

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.