c++ project on banking system

Upload: krishna-chaitanya

Post on 04-Apr-2018

314 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 C++ Project On Banking System

    1/22

    Computer ScienceProgramming Project

    2012 2013

    Submitted By :- Krishna Chaitanya

    Class :- XII ARoll No :-

  • 7/29/2019 C++ Project On Banking System

    2/22

    Krishna Chaitanya

    XII A

  • 7/29/2019 C++ Project On Banking System

    3/22

    CertificateThis is to certify thatKrishna Chaitanya of XII

    Science of Roll No. ________ has satisfactorily

    completed the project in Computer Science forAISSCE as per CBSE guidelines for the year 2012-

    2013

    Signature of Internal Examiner Signature of Principal

    Signature of External Examiner

    Stamp

  • 7/29/2019 C++ Project On Banking System

    4/22

    //***************************************************************

    // HEADER FILE USED IN PROJECT

    //****************************************************************

    #include

    #include

    #include

    #include

    #include

    //***************************************************************

    // CLASS USED IN PROJECT

    //****************************************************************

    class account{

    int acno;

    char name[50];

    int deposit;

    char type;

    public:

    void create_account(); //function to get data from uservoid show_account(); //function to show data on screen

    void modify(); //function to get new data from user

    void dep(int); //function to accept amount and add to balance

    amount

  • 7/29/2019 C++ Project On Banking System

    5/22

    void draw(int); //function to accept amount and subtract from

    balance amount

    void report(); //function to show data in tabular format

    int retacno(); //function to return account numberint retdeposit(); //function to return balance amount

    char rettype(); //function to return type of account

    }; //class ends here

    void account::create_account()

    {

    coutacno;

    coutdeposit;

    cout

  • 7/29/2019 C++ Project On Banking System

    6/22

    cout

  • 7/29/2019 C++ Project On Banking System

    7/22

    {

    cout

  • 7/29/2019 C++ Project On Banking System

    8/22

    void display_all(); //function to display all account details

    void deposit_withdraw(int, int); // function to desposit/withdraw amount for

    given account

    void intro(); //introductory screen function

    //***************************************************************

    // THE MAIN FUNCTION OF PROGRAM

    //****************************************************************

    int main()

    {char ch;

    int num;

    clrscr();

    intro();

    do

    {

    clrscr();cout

  • 7/29/2019 C++ Project On Banking System

    9/22

    cin>>ch;

    clrscr();

    switch(ch)

    {case '1':

    write_account();

    break;

    case '2':

    coutnum;

    deposit_withdraw(num, 1);break;

    case '3':

    coutnum;

    deposit_withdraw(num, 2);

    break;

    case '4':coutnum;

    display_sp(num);

    break;

    case '5':

    display_all();

    break;case '6':

    coutnum;

    delete_account(num);

  • 7/29/2019 C++ Project On Banking System

    10/22

    break;

    case '7':

    coutnum;modify_account(num);

    break;

    case '8':

    cout

  • 7/29/2019 C++ Project On Banking System

    11/22

    outFile.close();

    }

    //***************************************************************// function to read specific record from file

    //****************************************************************

    void display_sp(int n)

    {

    account ac;

    int flag=0;ifstream inFile;

    inFile.open("account.dat",ios::binary);

    if(!inFile)

    {

    cout

  • 7/29/2019 C++ Project On Banking System

    12/22

    if(flag==0)

    cout

  • 7/29/2019 C++ Project On Banking System

    13/22

    int pos=(-1)*sizeof(account);

    File.seekp(pos,ios::cur);

    File.write((char *) &ac, sizeof(account));

    cout

  • 7/29/2019 C++ Project On Banking System

    14/22

    outFile.open("Temp.dat",ios::binary);

    inFile.seekg(0,ios::beg);

    while(inFile.read((char *) &ac, sizeof(account)))

    {if(ac.retacno()!=n)

    {

    outFile.write((char *) &ac, sizeof(account));

    }

    }

    inFile.close();

    outFile.close();remove("account.dat");

    rename("Temp.dat","account.dat");

    cout

  • 7/29/2019 C++ Project On Banking System

    15/22

    return;

    }

    cout

  • 7/29/2019 C++ Project On Banking System

    16/22

    cout>amt;

    ac.dep(amt);

    }if(option==2)

    {

    cout>amt;int bal=ac.retdeposit()-amt;

    if((bal

  • 7/29/2019 C++ Project On Banking System

    17/22

    else

    ac.draw(amt);

    }

    int pos=(-1)* sizeof(ac);File.seekp(pos,ios::cur);

    File.write((char *) &ac, sizeof(account));

    cout

  • 7/29/2019 C++ Project On Banking System

    18/22

    //***************************************************************

    // END OF PROJECT

    //***************************************************************

  • 7/29/2019 C++ Project On Banking System

    19/22

  • 7/29/2019 C++ Project On Banking System

    20/22

    1.New Account Option

    2.Deposit Amount Option

    3.Withdraw Amount Option

  • 7/29/2019 C++ Project On Banking System

    21/22

    4.Balance Enquiry Option

    5.All Account Holder List Option.

    6.Close An Account Option

  • 7/29/2019 C++ Project On Banking System

    22/22

    7.Modify An Account Option

    8.Exit Option