A Banking System With Normal Transaction

  • Upload
    lalboy

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 A Banking System With Normal Transaction

    1/58

  • 8/14/2019 A Banking System With Normal Transaction

    2/58

    PREFACE

    For effective and sound management, anorganization

    Require a software program that exclusively fulfills its everincreasing indispensable needs thereby rendering success onsumptuous target in time.

    In order to accomplish the above stated success acompetent technology is required. So, I present a software inC++ on BANKING MANAGEMENT SYSTEM. Thoughevolving such a software in C++ entails a lot of diligence yet

    accomplishment of a fully operable and user friendly softwareis not feasible.

    The project manages the daily transactions of bankviz. opening/closing accounts, deposits, withdrawals,generating account statements, account info, calculation ofinterests and many more .

    The project has been designed with meticulouspreparation and astute analysis of the subject with the soleaim to meet and satisfy the needs .To err is human. Keenefforts have been made to avoid the shortcomings.Though the suggestions/criticism in this regard will begratefully acknowledged.

    2

  • 8/14/2019 A Banking System With Normal Transaction

    3/58

  • 8/14/2019 A Banking System With Normal Transaction

    4/58

    INTRODUCTION

    The task of managing the daily transactions at a bankviz. opening/closing accounts, deposits, withdrawals,generating account statements, account info, calculation ofinterests , etc. entails sheer amount of endeavor andmaintenance. The need is of an efficient application thatunravels the problems. The project on THE BANKING

    SYSTEMhere presented unravels most of the aboveproblems.

    The complete project has been developed in C++ which

    perhaps is a good programming language having an object-

    oriented approach. The concept offile handling and classes

    has been deployed to render extensive functionality to the

    project. The application includes a login portal to the systemfrom where a user can login to the main application page

    perform all the above listed functions/transactions by opting

    the required choice in a very easy and lucid manner. Though

    the application is based on the conventional file system,

    efforts have been applied to fulfill all the requirements and

    make the project user friendly. In spite of this, the projectoffers functionality near to the widely used database system.

    4

  • 8/14/2019 A Banking System With Normal Transaction

    5/58

    We have tried to incorporate nearly all the functions

    that are required in banks and assure that it will meet theneeds extensively.

    OVERVIEW OF C++

    C++ is an object oriented programming language.It was developed byBjarne stroustrup at AT&T Bell Laboratoriesin New Jersey, USA in the early 1980s. Stroustrup combined bestfeatures of the languagessimula67and Cand created a languagethat could support object-oriented programming features retaining

    the power and elegance of C. The result was C++. Simula67 addedthe feature of object oriented programming. The new language wasalso known as C with classes.

    Being the superset of C, C++ provides the additionalobject-oriented features which includes objects, classes, dataabstraction and encapsulation, inheritance, polymorphism, dynamicbinding, message passing, function overloading and operator

    overloading . These features enable creation of abstract data types,inherit properties from existing data types and polymorphism,thereby making C++ a truly object-oriented language.

    Objects are basic runtime entities in an object-oriented system. They are chosen such that they match closelywith the real world objects. Objects take up space in the memoryand have an associated address. When a program is executed, the

    objects interact by sending messages to one another.

    5

  • 8/14/2019 A Banking System With Normal Transaction

    6/58

    Classes are the most remarkable feature of C++. The

    class binds together data and which work on data. The class is anabstract datatype so creation of class simply creates a template. Inclass we define data members and member functions. There arethree different types of modes:public, private and protected. Datamembers and functions declared under the public mode can be usedinside and outside the class. Private data members and functionscan only be used inside the class. Protected data members andfunctions can be used inside the class and any class immediately

    derived from it.

    Inheritance is the process by which objects of oneclass acquire the properties of objects of another class. In OOP,inheritance provides the idea of reusability. This means that we canadd additional features to an existing class without modifying it.They are of five types viz. single, multiple, multilevel, hybrid andhierarchial.

    File handlingis the mechanism used to access datafiles using C++ codes. We can read or write any data to a data file.In this project we are using data files like newrecords.dat, calcu-lations.txt& transactions.dat respectively used to store recordsof account holders, store the calculations related to the accounts,store the transactions processed to the accounts.

    The object-oriented features in C++ allow program-mers to build large programs with clarity, extensibility, and easeof maintenance.

    6

  • 8/14/2019 A Banking System With Normal Transaction

    7/58

    SYSTEM REQUIREMENTS

    HARDWARE REQUIREMENTS :

    Processor Intel Pentium III processor or higher RAM 128 MB or higher Hard disk 10 GB or higher

    SOFTWARE REQUIREMENTS :

    Operating System MS Windows 2000 or

    Higher / Linux

    Compiler TurboC /TurboC++/BorlandC

    OrMS Visual C++

    7

  • 8/14/2019 A Banking System With Normal Transaction

    8/58

    PROGRAM

    CODE

    8

  • 8/14/2019 A Banking System With Normal Transaction

    9/58

  • 8/14/2019 A Banking System With Normal Transaction

    10/58

    {public:

    void addDetails(int,charname[30],char address[60],float);void displayCustomers();void deleteAccount(int);void updateBalance(int,float);void updateCustomer();int lastAccount();int accountExists(int);

    char *getName(int);char *getAddress(int);float getBalance(int);int getRecord(int);void display(int);void displayList();int AccountNumber;char name[50],address[50];

    float intBalance;};

    //The class has all the transaction relatedmethodsclass accountTransactions{

    public:

    void new_account();void closeAccount();void display_account();void transaction();void addDetails(int,int,int,int,char,char typeTransaction[15], float,float,float);void deleteAccount(int);

    int dateDiffer(int,int,int,int,int,int);

    10

  • 8/14/2019 A Banking System With Normal Transaction

    11/58

    float getInterest(int,float);void display(int);void showAccount(int);int AccountNumber;//variable for Account Numberchar trantype[10];//variable of cheque or cash input

    oroutputint dday,mmonth,yyear;

    //transaction datechar transactions;//type of transactions - Deposit orWithdrawal of Amountfloat intInterest,intAmount,

    intBalance;static float calcInterest;void showInterest();

    //added};

    //showmenu() method to display the Main Menuint the applicationvoid Menus :: showmenu(){

    char choice;

    while(1){clrscr();cout

  • 8/14/2019 A Banking System With Normal Transaction

    12/58

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    13/58

    closemenu();}else if(choice=='7'){cout

  • 8/14/2019 A Banking System With Normal Transaction

    14/58

    else if(choice=='0'){cout

  • 8/14/2019 A Banking System With Normal Transaction

    15/58

    while(filename.read((char *)this,sizeof(dispRecords)))

    {count++;if(retrieve_AccNo==AccountNumber){break;

    }/*keep on counting the record till theAccount Number is found and exit from the

    newrecords.dat file.*/}filename.close();return count;

    }

    // display() method display all the details ofthe Account Number from the newrecords.dat

    filevoid dispRecords :: display(intretrieve_AccNo){int record;record=getRecord(retrieve_AccNo);fstream filename;filename.open("newrecords.dat",ios::in);

    filename.seekg(0,ios::end);int location;location=(record)*sizeof(dispRecords);filename.seekp(location);

    while(filename.read((char *)this,sizeof(dispRecords)))

    {

    if(retrieve_AccNo==AccountNumber){

    15

  • 8/14/2019 A Banking System With Normal Transaction

    16/58

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    17/58

  • 8/14/2019 A Banking System With Normal Transaction

    18/58

    }}filename.close();return iBalance;

    }

    //accountExists() method checks if the Accountexists in the newrecords.dat file or not.int dispRecords::accountExists(intretrieve_AccNo)

    {fstream filename;filename.open("newrecords.dat",ios::in);filename.seekg(0,ios::beg);int count=0;

    while(filename.read((char *)this,sizeof(dispRecords)))

    {if(AccountNumber==retrieve_AccNo){count=1;break;

    }}filename.close();

    return count;}

    /* displayList() method displays the output ofall the Accounts in a proper format for thechoice 3*/void dispRecords :: displayList(){cout

  • 8/14/2019 A Banking System With Normal Transaction

    19/58

    struct date dateval;getdate(&dateval);day1=dateval.da_day;month1=dateval.da_mon;year1=dateval.da_year;cout

  • 8/14/2019 A Banking System With Normal Transaction

    20/58

    return ; //fclose(pFile); }else{displayList();filename.open("newrecords.dat",ios::in);filename.seekg(0,ios::beg);while(filename.read((char *)this,

    sizeof(dispRecords)))

    {check=0;cout.fill(' ');cout

  • 8/14/2019 A Banking System With Normal Transaction

    21/58

  • 8/14/2019 A Banking System With Normal Transaction

    22/58

  • 8/14/2019 A Banking System With Normal Transaction

    23/58

    temp.close();}

    // updateBalance() method updates the balanceof the Account Number after a transaction isdone in the newrecords.dat filevoid dispRecords::updateBalance(int retrieve_AccNo,

    float iBalance)

    {int record;

    record=getRecord(retrieve_AccNo);fstream filename;

    filename.open("newrecords.dat",ios::out|ios::ate);intBalance=iBalance;int location;location=(record-1)*sizeof(dispRecords);filename.seekp(location);

    filename.write((char *)this,sizeof(dispRecords));filename.close();

    }

    // addDetails() method adds the details of atransaction in the transactions.dat filevoid accountTransactions::addDetails(int

    retrieve_AccNo,int

    day1,int month1,intyear1,char t_tran,char typeTransaction[10],float interest_accrued,float t_amount,floatiBalance)

    {fstream filename;filename.open("transactions.dat",ios::app);

    AccountNumber=retrieve_AccNo;

    23

  • 8/14/2019 A Banking System With Normal Transaction

    24/58

    dday=day1;mmonth=month1;yyear=year1;transactions=t_tran;strcpy(trantype,typeTransaction);intInterest=interest_accrued;intAmount=t_amount;intBalance=iBalance;filename.write((char *)this,

    sizeof(accountTransactions))

    ;}

    // deleteAccount() method deletes the recordof a transaction from the transactons.dat filevoid accountTransactions :: deleteAccount(int

    retrieve_AccNo){

    fstream filename;filename.open("transactions.dat",ios::in);fstream temp;temp.open("calculations.txt",ios::out);filename.seekg(0,ios::beg);while(!filename.eof()){filename.read((char *)this,

    sizeof(accountTransactions));if(filename.eof()){break;

    }if(AccountNumber!=retrieve_AccNo){

    temp.write((char *)this,

    24

  • 8/14/2019 A Banking System With Normal Transaction

    25/58

    sizeof(accountTransactions));

    }}filename.close();temp.close();filename.open("transactions.dat",ios::out);temp.open("calculations.txt",ios::in);temp.seekg(0,ios::beg);while(!temp.eof())

    {temp.read((char *)this,

    sizeof(accountTransactions));

    if(temp.eof()){break;

    }

    filename.write((char *)this,sizeof(accountTransactions))

    ;}filename.close();temp.close();

    }

    // new_account() method adds a new record inthe newrecords.dat file and transactions.datfiles(choice 1)void accountTransactions :: new_account(void){char choice;int i,check;clrscr();

    dispRecords newRec;cout

  • 8/14/2019 A Banking System With Normal Transaction

    26/58

    previous menu. \n";cout

  • 8/14/2019 A Banking System With Normal Transaction

    27/58

    check=1;gets(retrieve_CustName);if(retrieve_CustName[0]=='0'){cout

  • 8/14/2019 A Banking System With Normal Transaction

    28/58

    {check=0;cout

  • 8/14/2019 A Banking System With Normal Transaction

    29/58

    }while(!check);

    do{cout

  • 8/14/2019 A Banking System With Normal Transaction

    30/58

    choice=toupper(choice);}while(choice!='N' && choice!='Y');if(choice=='N'||choice=='n'){cout

  • 8/14/2019 A Banking System With Normal Transaction

    31/58

    retrieve_AccNo){cout

  • 8/14/2019 A Banking System With Normal Transaction

    32/58

  • 8/14/2019 A Banking System With Normal Transaction

    33/58

    pFile=fopen("newrecords.dat","r");if(pFile==NULL){cout

  • 8/14/2019 A Banking System With Normal Transaction

    34/58

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    35/58

    getch();}

    }

    // dateDiffer() method displays the differencebetween 2 dates.int accountTransactions :: dateDiffer(intday1,

    int month1,intyear1, int day2,int

    month2,int year2){static int monthArr[]={31,28,31,30,31,30,31,

    31,30,31,30,31};//Array of months for storing the no. of

    daysin each arrayint days=0;

    while(day1!=day2||month1!=month2||year1!

    =year2){

    /* checking if the two dates in days,monthand years differ and incrementing thenumber of days.*/days++;

    day1++;if(day1>monthArr[month1-1]){day1=1;month1++;

    }if(month1>12){

    month1=1;year1++;

    35

  • 8/14/2019 A Banking System With Normal Transaction

    36/58

    }}return days;

    }

    // getInterest() function calculates intereston the balance from the transactions.dat filefloat accountTransactions :: getInterest(int

    retrieve_AccNo,float iBalance)

    {fstream filename;filename.open("transactions.dat",ios::in);dispRecords newRec;filename.seekg(0,ios::beg);int day1,month1,year1,month_day;while(filename.read((char *)this,

    sizeof(accountTransactions))

    ){if(AccountNumber==retrieve_AccNo){day1=dday;month1=mmonth;year1=yyear;

    iBalance=newRec.getBalance(retrieve_AccNo);

    break;}}int day2,month2,year2;struct date dateval;getdate(&dateval);day2=dateval.da_day;month2=dateval.da_mon;

    year2=dateval.da_year;float interest_accrued=0.0;

    36

  • 8/14/2019 A Banking System With Normal Transaction

    37/58

    int yeardiff=year2-year1;

    if((year2

  • 8/14/2019 A Banking System With Normal Transaction

    38/58

    }

    /*Method for generating Interest and updationof the Balance and addDetails methods.(choice5)*/void accountTransactions :: showInterest(){clrscr();char t_acc[10];int tran_acc,retrieve_AccNo,check;

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    39/58

    }cout

  • 8/14/2019 A Banking System With Normal Transaction

    40/58

    interest_accrued=getInterest(retrieve_AccNo,

    iBalance); /* Calculation of interest of the deposit

    amount*/ cout

  • 8/14/2019 A Banking System With Normal Transaction

    41/58

    if(retrieve_AccNo==0){return;

    }clrscr();dispRecords newRec;if(!newRec.accountExists(retrieve_AccNo)){cout

  • 8/14/2019 A Banking System With Normal Transaction

    42/58

    strcpy(retrieve_Address,newRec.getAddress(retrieve_AccNo))

    ;iBalance=newRec.getBalance(retrieve_AccNo);cout

  • 8/14/2019 A Banking System With Normal Transaction

    43/58

    {cout

  • 8/14/2019 A Banking System With Normal Transaction

    44/58

    \n";getch();

    }}while(!check);char choice;

    do{cout

  • 8/14/2019 A Banking System With Normal Transaction

    45/58

    iBalance=iBalance-t_amount;}

    newRec.updateBalance(retrieve_AccNo,iBalance); /* Adding record details for the Transaction

    done (deposit or withdrawal) and savingit

    in the file*/ addDetails(retrieve_AccNo,day1,month1,year1,tranDetails,typeTransaction,interest_accrued

    ,

    t_amount,iBalance);}

    /* This method deletes the Account from boththe dat files(Choice 6)*/void accountTransactions :: closeAccount(void){clrscr();

    char t_acc[10];int tran_acc,retrieve_AccNo;cout

  • 8/14/2019 A Banking System With Normal Transaction

    46/58

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    47/58

    cout

  • 8/14/2019 A Banking System With Normal Transaction

    48/58

    {ch=getch();if(isalnum(ch)){b[i]=ch;cout

  • 8/14/2019 A Banking System With Normal Transaction

    49/58

    Password.";cout

  • 8/14/2019 A Banking System With Normal Transaction

    50/58

    PROGRAMOUTPUTS

    50

  • 8/14/2019 A Banking System With Normal Transaction

    51/58

    LOGIN PAGE

    51

  • 8/14/2019 A Banking System With Normal Transaction

    52/58

  • 8/14/2019 A Banking System With Normal Transaction

    53/58

    ALL ACCOUNTS INFO

    TRANSACTION PAGE53

  • 8/14/2019 A Banking System With Normal Transaction

    54/58

    INTEREST GENERATION PAGE

    54

  • 8/14/2019 A Banking System With Normal Transaction

    55/58

    ACCOUNT CLOSING PAGE

    55

  • 8/14/2019 A Banking System With Normal Transaction

    56/58

    EXIT PAGE

    CONCLUSION

    The project presented on the banking managementsystem rendered us valuable erudition.Working on the project

    made us aware of the daily transactions and works in the banks.It rendered us knowledge in depth. It also made us aware ofthe varied usage of C++ in the field of software development.

    File handling in C++ proved to be a magicwand in creation of the application. It not only minimized thetime of creation and the complexity of the code but alsohelped us to render proper shape to the application. Moreover

    it also provided us with the knowledge of its usage in the fieldof application development.

    56

  • 8/14/2019 A Banking System With Normal Transaction

    57/58

    The application performed well than was

    expected. The operations of account opening, viewingaccount info, generating interests and closing of accountwere accomplished successfully.

    The successful completion of project has providedus the proper opine and now we look forward to getinvolve in more projects like this.

    BIBLIOGRAPHY

    Balagurusamy,E.(2007),Object-orientedprogramming with C++,New Delhi :The McGraw

    Hill Companies

    Gottfried,Byron S.(2007),Programming with C++,

    New Delhi :The McGraw Hill Companies

    57

  • 8/14/2019 A Banking System With Normal Transaction

    58/58

    COMMENTS/SUGGESTIONS