Dharender Jangra

Embed Size (px)

Citation preview

  • 8/8/2019 Dharender Jangra

    1/125

    Executive Director DOEACC Society6, CGO Complex

    Lodhi Road New Delhi-110003

    Sir,

    I am submitting my A - Level Project for evaluation. Details of myRegistration and postal address, etc. are as under:

    Regn. No. : Level :- A

    Name : Dharender Jangra

    Father's Name : Sh. Rati Ram Jangra

    Address :a) Residential Address: Jangra Bhawan, H.No. 380, Street No. 2,

    Bhatia Colony, Fatehabad - 125050(Haryana)

    Tele. No. 01667- 227397, 9896004397

    b) Office Address Manohar Memorial CollegeFatehabad-125050(Haryana)

    Tele. No. 01667- 227378, 227379

    Fax No. 01667 -

    Email Address: [email protected]

    mailto:[email protected]:[email protected]
  • 8/8/2019 Dharender Jangra

    2/125

    COMPUTERISEDBANKING SYSTEM

    Submitted by Dharender Jangra

    Reg. No.472284

    Submitted on :March 02, 2008

    Under the guidance of Ms. Preeti

    Submitted in partial fulfillment of the requirements for qualifyingDOEACC A- Level

    2

  • 8/8/2019 Dharender Jangra

    3/125

    Table of Contents

    S.No. Description Page. No.

    ----------------------------------------------------------------------------------------1. Acknowledgement

    2. Certificate of the project guide

    3. Certificate of the Organisation

    4. Main Report

    5. Objective & Scope of the Project

    6. Theoretical Background

    7. Definition of Problem

    8. System Analysis & Design /User Requirements

    9. System Planning (PERT Chart)

    10. Methodology adopted,

    11. Details of Hardware & Software used

    12. System Maintenance & Evaluation

    13. Cost and benefit Analysis

    14. Detailed Life Cycle of the Project

    15. DFD

    3

  • 8/8/2019 Dharender Jangra

    4/125

    16. Input and Output Screen Design

    17. Methodology used for testing

    18. User/Operational Manual

    Annexures:

    1. Brief background of the organization

    2. Data Dictionary

    3. List of abbreviations, Figures, Tables

    4. Reference

    5. Bibliography

    6. Soft copy of the project in C.D

    4

  • 8/8/2019 Dharender Jangra

    5/125

    INTRODUCTION

    Computers today are entering every sphere of life. This is due tothere high speed of processing, accuracy, tireless and efficient working.This project has been designed to computerize the working otherwisemanual working. This project aims at managing daily banking activitiesand weekly, monthly and yearly reports.

    Since the numbers of accounts leadger ,books transactions &customers are increasing day by day, it becomes hard for the bank staff to manage daily banking activities. So the aim of the project is to arm the

    banking staff with an efficient tool to perform various activities such asissuing the returning of books, updating of the list of available books,calculation of fine after due date is over etc. All of these activities can be

    performed by comparatively less number of employees and with moreconvenience and accuracy with the help of this new system.

    The programs of the project have been divided into simple andsmaller modules, so that in case of any change in the basic data of the

    bank there is no need to make big changes. Only changes in smaller modules will do the job.

    Provisions have been made to incorporate any changes that maycome into picture from time to time regarding the rules and regulationsof the bank .

    5

  • 8/8/2019 Dharender Jangra

    6/125

    Acknowledgement

    This project entitled Banking System is done in C++ during the

    course of A-Level. It gives me tremendous pleasure in acknowledging

    the valuable assistance extended to me by various persons in successful

    completion of this project report.

    I have no words to express my sincere gratitude and indebtedness

    to my esteemed taught teacher Mrs. Preeti under whose ever available

    and individual guidance, in spite of her busy schedule, I had completed

    this project successfully.

    And above all more than the usual debt of my gratitude must be

    expressed to my parents who provide me the best environment for my

    studies.

    In the last, but not least I would like to thanks Sh. J.L Thakkar,

    Director, Manohar Memorial Institute of Computer Education Fatehabad.

    I also express my sense of gratitude towards the Principal and the Library

    staff of Daffodils Public School, Fatehabad for their valuable time and

    assistance they provided me to complete this project.

    Infact no words can express our gratitude towards all above.

    Dharender Jangra

    Reg. No 472284

    6

  • 8/8/2019 Dharender Jangra

    7/125

    Certificate

    This is to certify that the Project entitled, Banking System is

    a bonafide work done by Mr. Dharender Jangra (DOEACC

    Registration No. 472284 ) in partial fulfillment of A- Level

    examination and has been carried out under my direct supervision and

    guidance. This report or a similar report on the topic has not been

    submitted for any other examination and does not form part of any other

    course undergone by the candidate.

    CountersignedSignature of Guide/Supervisor

    DIRECTOR,

    Name : Mrs. Preeti Manohar MenorialInstitute Of Computer Education, Fatehabad

    Designation: Lecturer in Computer Sc. Pin-25050Place : MMICE, Fatehabad Haryana

    Date : March 02, 2007

    7

  • 8/8/2019 Dharender Jangra

    8/125

    Main

    Report

    8

  • 8/8/2019 Dharender Jangra

    9/125

    Objectives

    and

    scope

    of the

    project

    9

  • 8/8/2019 Dharender Jangra

    10/125

    Objectives and scope of the project

    Objectives :

    The objective of this project is to automate the job of

    banking system thereby reducing the overheads and work of staff of

    banking system and the students who want to learn about the banking

    system and saving the lot of time and increasing the efficiency of both

    the staff and the customers.

    PROPOSED SYSTEM FEATURES

    Proposed system is a much more efficient computerized system.

    Due to complexity and complication of work in the existing system.

    There is a need of expert tutor which is capable to solving their

    problems. We can say if employee due to reliability, efficiency, accuracy

    and simplicity and facility of typing better performs.the proposedsystem

    would be reliable and user friendly as well.

    10

  • 8/8/2019 Dharender Jangra

    11/125

    THEORETICAL

    BACKGROUND

    11

  • 8/8/2019 Dharender Jangra

    12/125

    THEORETICAL BACKGROUND

    This project report tries to replace the manual system with the

    computerized system. Any person can become the expert in banking by

    prescribed form. This membership is given course duration, during

    which members can avail following facilities.

    1. Open new Accounts.

    2. List of Accounts.

    3. IndAccount.

    4. DailyTrans.

    5. Monthly Report.

    6. Edit Account.

    After these formalities, anyone can use it and can

    learn more about it.

    Selection of Project :

    Selection of project is most important and toughest

    step in developing a project. We should select one project with careful

    consideration of money, time available and avoiding repletion.Our

    12

  • 8/8/2019 Dharender Jangra

    13/125

    project should be working model as well as charming and challenging

    one.

    While selecting a project, following factors to be considered :-

    1. The project should be sent to the organization for which it has

    been designed.

    2. The project should be easy to use even to less skilled user.

    3. The project should be economical.

    4. The project should be selected which in not ready available.

    5. The project should be easy to maintain & use.

    6. The project should be easy to understand.

    13

  • 8/8/2019 Dharender Jangra

    14/125

    Definition

    of

    Problems

    14

  • 8/8/2019 Dharender Jangra

    15/125

    Definition of problems

    Problem of The Physical/Manual System

    Various problems of physical system are described below:-

    First of all there is no doubt that physical system is time

    consuming. And at present where the world goes in fast track the

    physical system of any project is not valid. If one is not very careful them there is a possibility of

    making mistakes in using keys.

    There is a possibility of taking so much time which reduces

    the efficiency of user .

    When there is a need to feed the data in particular time

    usually the user/staff member cannot finish it in that particular time.

    Answering that query is a time consuming process.

    Holding the Banking books is a very difficult . The process

    involved required a lot of accuracy and a time bound process

    as it types something .The software developed should be ready to solve all the queries of

    all the problems coming to the any person using computer. Therefore it

    was decided to make the project in C++, the one of the most powerful

    15

  • 8/8/2019 Dharender Jangra

    16/125

    and versatile programming languages. Thus the problem is solved by

    designing a project which caters to its all need. A simple effort is done

    in the form of this project BANKING SYSTEM.

    This problem is solved by designing a project which caters to

    its all need. A simple effort is done in the form of this project Banking

    System.

    This document is the feasibility study apart on the system

    development. Organizations are backbone of a country and play major

    role in the development of a country. Organizations are actually the

    systems which are very complex in the nature.

    During the development of project on Banking System the

    emphasis is on all the work problems of the banking system.The

    emphasis was given to correct the data and entries very efficiently. Any

    person can learn very easily and can understand it very quickly.

    16

  • 8/8/2019 Dharender Jangra

    17/125

    SYSTEM

    ANALYSIS

    AND

    DESIGN

    17

  • 8/8/2019 Dharender Jangra

    18/125

    SYSTEM ANALYSIS AND DESIGN

    Formulation of the Problem:

    This project basically aims at the activities like typing accurate

    words in a time and can be eligible for typing without errors.The Whole procedure of the system can be summarized as follows:

    The existing system is basically a system involving a lot of

    concentration on keys and on screen as well.It will take a lot of time and

    also there is a possibility of errors and the there is a need of

    maintenance of number of files. It is so difficult to correct these

    mistakes in little time. So, we find that there is a lot of wastage of time

    and money. It is very much error prone because there are entitlement

    checks. The error that lies in the manual system cannot be easily

    rectified. Similar problems is described as below:

    1. If a employee does the journal and the book-posting, it takes

    so much time and book storage is so difficult.2. To edit the data and any entry,it is very difficult with manual

    system.

    3. To modify the accounts in manual system is also difficult.

    18

  • 8/8/2019 Dharender Jangra

    19/125

    4. Error-Prone is easy to rectify in the computerized system.

    5. Difficult to rectify the data, but easy with the this system.

    6. They can see information regarding accuracy,reliability.

    The existing system is basically a system involving a lot of concentration

    on keys and on screen as well.It will take a lot of time and also there is a

    possibility of errors and there is a need of maintenance of number of

    files. It is so difficult to correct these mistakes in little time. So, we find

    that there is a lot of wastage of time and money. It is very much error

    prone because there are entitlement checks. The error that lies in the

    typing cannot be easily rectified.

    SYSTEM ANALYSIS

    Analysis refers to the study of what the system should do.It

    involves an indepth study of existing system., needs of the organizationand user. Design of the system according to the user specification needs

    is the most crucial part of the system.

    During the analyzing the existing system, we analyses the whole

    procedure of the system and its procedure refers to the process of

    examining and organizations situations with intention of improvement

    through better method.

    19

  • 8/8/2019 Dharender Jangra

    20/125

    In order to design and project, it is required to adopt system

    analysis steps. With the implementation of system analysis in project

    making it becomes quite easier to design the project, creating its System

    Chart, coding, its implementation and testing.

    20

  • 8/8/2019 Dharender Jangra

    21/125

    SYSTEM

    PLANNING

    (SYSTEM CHART )

    21

  • 8/8/2019 Dharender Jangra

    22/125

    METHODOLOGY

    ADOPTED

    22

  • 8/8/2019 Dharender Jangra

    23/125

    M ETHODOLOGY ADOPTED

    The chief problem with the computer programs is

    complexity. Large programs are probably the most complicated entities

    every created by human. Because of this complexity, programs are prone

    to error and software errors can expensive and even life threatening.

    Object Oriented Programming offers a new and powerful way to cope

    with the complexity. Its goal is clearer, more reliable. More easily

    maintained program. That is why C++ is used.

    Prerequisites

    For executing any software or application, certain requirements are

    essential to be fulfilled by the user or the organization, which are broadly

    categorized as under:

    1. Software Requirements :

    It is the most dramatic innovation in software development in

    the last decade. It ranks in importance with the devolpment

    of the first higher level language at the dawn of the computer

    23

  • 8/8/2019 Dharender Jangra

    24/125

    age. Sooner or later every programmer will be affected by

    the Object-Oriented approach to program design.

    2. Hardware Requirements :

    Processor Pentium Processor

    RAM 16 MB or above

    HDD 2.1 GB or above

    Monitor Color

    FDD 1.44 MB

    Keyboard 101 Keys.

    24

  • 8/8/2019 Dharender Jangra

    25/125

    DETAILED

    LIFE CYCLE OF

    THE PROJECT

    25

  • 8/8/2019 Dharender Jangra

    26/125

    SYSTEM DEVELOPMENT LIFE CYCLE :

    System development, a process consisting of two major steps of

    systems analysis and design, starts when management or sometimes

    system development personal feel that a new system or an improvement

    in the existing system is required. The system development life cycle is

    classically thought of as the set of activities that analysis, designer and

    uses carry out to develop and implement an information system. The

    system development life cycle consists of the following activities :

    1. Preliminary investigation

    2. Determination of system requirement

    3. Design of system

    4. Development of software

    5. System Testing

    6. Implementation, evaluation and maintenance

    1. Preliminary investigation

    This activity has three parts:

    a. Request clarification

    b. Feasibility Study

    26

  • 8/8/2019 Dharender Jangra

    27/125

    c. Request approval

    a. Request Clarification :It is necessary that project request must be examined and

    clarified properly before considering system investigation.

    b. Feasibility study :It has also three parts as follows:

    i) Technical Feasibility : Can the work for the project bedone with current equipment existing software technology

    and available personal? If new technology is needed, what is

    the likelihood that it can be developed?

    27

  • 8/8/2019 Dharender Jangra

    28/125

    ii) Economic Feasibility : Are there sufficient benefits

    in creating he system to make to the costs acceptable? Or, are

    the costs of not creating the system so great that it is

    advisable to undertake the project?

    iii) Operational Feasibility : Will the system be usedif it is developed and implemented? Will there be resistancefrom users that will undermine the possible application

    benefits?

    The feasibility study is carried out by a small group of people who

    are familiar with information systems techniques, understand the parts of

    the business or organization that will be involved or affected by the

    project, and are skilled in the systems analysis and design process.

    Request Approval : It is not necessary that all requested projects are

    desirable or feasible. Some organization receive so mach project requests

    from employees that only a few of them can be pursued. However, those

    projects that are feasible and desirable should be put into a schedule. In

    some cases, development can start immediately, although usually

    systems staff members are busy on other on going projects. When such

    situations arises, management decides which project are most urgent and

    28

  • 8/8/2019 Dharender Jangra

    29/125

    schedules them accordingly. After a project request is approved, its cost,

    priority, completion time, and personal requirements are estimated and

    used to determine where to add it to any exciting project list Later on,

    when the other projects have been completed, the proposed application

    development can be initiated.

    Design of System

    The design of information system produces the details that clearly

    describe how a system will met the requirements identified during

    systems analysis. System specialists often refer to this stage as logicaldesign. In contrast to the process of developing programmer software,

    which is referred to as physical design.

    Development of Software

    Software developers may install purchased software or they may develop

    new, customer designed programs. Generally it has been observed that

    programmers are part of permanent professional staff in a big

    organization. In smaller organization without programmers, outside

    programming services may be hired or retained on the contractual basis.

    This library project can be developed of can be purchased.

    29

  • 8/8/2019 Dharender Jangra

    30/125

    SYSTEM

    CHART

    30

  • 8/8/2019 Dharender Jangra

    31/125

    I NPUT

    AND

    OUTPUT

    DESIGN

    31

  • 8/8/2019 Dharender Jangra

    32/125

    INPUT AND O UTPUT SCREEN DESIGN

    * * * * Welcome in Banking System * * * *

    NEW ACCOUNT

    LIST OF ACCOUNTS

    IND ACCOUNTS

    32

  • 8/8/2019 Dharender Jangra

    33/125

    MONTHLY REPORT

    EDIT ACCOUNT

    EXIT

    33

  • 8/8/2019 Dharender Jangra

    34/125

    SYSTEM

    TESTING

    34

  • 8/8/2019 Dharender Jangra

    35/125

    SYSTEM T ESTING

    M ETHODOLOGY USED FOR T ESTING :

    The purpose of the system testing is to identify and correct in the

    system. As important as this phase is, it is the one that is frequently

    compromised. Typically , the project is behind schedule or the user to

    too easier to go directly to conversion. The following performance

    criteria are used for system testing.

    1. T URNAROUND T IME : This is the elapsed time between the receipt of the

    input and the availability of the output. In one-line systems, high priority

    processing handled during peak hours, while low priority processing is

    done later in the day or during night shift.

    2. BACKUP: This term relates to the procedures to be used when thesystem is down. Backup plans might call for the use of another

    computer.

    The software for the candidate system must be tested for

    compatibility with the backup computer. In case of partial system

    breakdown, previous must be made for dynamic reconfiguration of the

    system.

    3. F ILE PROTECTION: This option pertains to sorting of files in a

    separate area for protection against fire, flood or their natural disaster.

    35

  • 8/8/2019 Dharender Jangra

    36/125

    Plans should also be established for reconstructing files damaged through

    a hardware malfunction.

    TYPES

    OF

    SYSTEM

    TESTS

    :After a test plan has been developed, system testing begins by

    testing program modules separately, followed by testing bundled

    modules as a unit. A program module function perfectly in isolation but

    fail when interacted with other modules. The approach is to test which

    entity endures with successively larger ones, up to the system test level.

    System testing consists of the following steps: -

    PROGRAM TESTING :- A program resresents the logical elements of a

    system. For a program to run satisfactoryily, it must compile and test

    data correctly and tie in properly with other programs. Achieving an

    error free program is the responsibility of the programmer. Program

    testing checks two types of errors as follow :

    a) Syntax Error :- A syntax error is one which occur when we

    violate any rule of the specified language.

    b) Logical Error : A Logical error on the other hand deals with the

    incorrect data, out of range items and invalid combinations.

    When a program is tested , the actual output is compared with the

    expected output. When there is a discrepancy, the sequence of

    instructions must be traced to determine the problem.

    36

  • 8/8/2019 Dharender Jangra

    37/125

    2.S TRING T ESTING : String test programs are invariably

    related to one another and interact in a total system. Each

    program is tested to see whether it confirms to related programs

    in the system. Each portion of the system is tested against the

    entire module with both test live data before the entire system is

    to be tested.

    3. S YSTEM T ESTING : System testing is a design to uncover weakness that were not found in earlier tests. This includes

    forced system failure and validation of the total system.

    Generally it begins with low volumes of transaction based on

    live data. The volume is increased until the maximum level for

    each transaction has been reached. The total system is also

    tested for recovery and fallback after various major failures to

    ensure that not data are lost during the emergencies.

    4. U SER ACCEPTANCE T ESTING : An acceptance test has the37

  • 8/8/2019 Dharender Jangra

    38/125

    objective of selling the user about the validity and reliability of

    the system. It verifies whether the system procedures operate as

    per system specifications and the integrity of vital data is

    maintained. Performance of an acceptance test is actually the

    users show. The motivation and knowledge of user are critical

    for the successful performance of the system. Then a

    comprehensive test report is prepared. The report indicates the

    systems as appended below :-

    i) Toleranceii) Performance range

    iii) Error rate

    iv) Accuracy

    During system testing, the system is used experimentally to ensure

    that the software does no fail. In other words, we can say that it will runaccording to its specifications and in the way users expect. Special test

    data are input for processing and the results examined. A limited of users

    may be allowed to use the system so that analyst can see whether they try

    to use it in unforeseen ways. This Project is Tested on the above facts.

    And it runs without any error.

    38

  • 8/8/2019 Dharender Jangra

    39/125

    IMPLEMENTATION

    E VALUATION

    39

  • 8/8/2019 Dharender Jangra

    40/125

    AND

    M AINTENANCE

    40

  • 8/8/2019 Dharender Jangra

    41/125

    IMPLEMENTATION , E VALUATION AND M AINTENANCE

    Implementation is the process of having system personal check out

    and put new equipment into use, train users, install the new application

    and construct any files of data needed to use it.

    Evaluation of the system is performed to identify its strengths and

    weakness.

    Maintenance is necessary to eliminate errors in the working system

    during its working life and to tune the system to any variations in its

    working environment. The importance of maintenances is to continue to

    bring the new system to standards.

    In this project Implementation is done at the level of personal

    check and we install this application of Pentium Computer III computer

    with configuration of 866 MHz. With some bulk data we stored the data.

    Evaluation is done by us we see that main strength of this project is that

    it is totally menu driven project and user friendly project. There are some

    minor weakness of this project but it can be igoned and can be remove

    and the Maintenance level. Maintenance level is needed time by time.

    41

  • 8/8/2019 Dharender Jangra

    42/125

    USER

    OPERATIONAL MANUAL

    42

  • 8/8/2019 Dharender Jangra

    43/125

    USER /O PERATIONAL M ANUAL

    For successful designing and implementation of any application, it

    highly required to manage the working affair of application by carefully

    designing the suitable platform for it. This platform includes backend

    main date-files and front and screen, which is used to manipulate

    backend data files.

    As per this rule, for this project M.S. DOS is used as backend tool

    for handling data files (*.Dat files) and at front end C++ is used for

    providing main screen to handle data files indirectly.

    Back-end files used:

    Lib.dat

    Temp.dat

    Memfile.dat

    Master.dat

    Fine.dat

    Front-end C++ features:

    Object

    Classes

    43

  • 8/8/2019 Dharender Jangra

    44/125

    Data abstraction

    Data encapsulation

    Inheritance

    Polymorphism

    Dynamic binding

    Message passing

    User defined graphical function

    Data Management function

    Report handling function

    Screen handling function

    Console function

    Duplicate technique of deleting

    44

  • 8/8/2019 Dharender Jangra

    45/125

    ANNEXURES

    45

  • 8/8/2019 Dharender Jangra

    46/125

    BRIEF BACKGROUND OF THE ORGANIZATION

    The Institute Manohar Memorial Institute of Computer

    Education, Fatehabad came in to existence in the year 2000, when

    DOEACC Society granted provisional accrediation to conduct the O

    Level Computer Course. Actually this institute is a part of the

    Manohar Memorial Education Society which has two more institutes

    under its banner.

    It has one Manohar Memorial College, Fatehabad, which is

    recognized from the Ch. Devi Lal University, Sirsa for Three year

    Degree classes. It is app. 33 year old college and has good name inthis area.

    The second one is Manohar Memorial Institute of

    Management and Technology, Fatehabad. This institute came into

    existence in the year 2002 when it was affiliated for M.C.A. (Master

    of Computer Education) from AICTE (All India Council for

    Technical Education, New Delhi. It is also recogniced from Ch. Devi

    Lal University, Sirsa.

    The Manohar Memorial Institute of Computer Education,

    Fatehabad was initially started with only O Level Computer Course,

    46

  • 8/8/2019 Dharender Jangra

    47/125

    but now it has two more courses in its list i.e. now it has A Level

    Computer course also as well as CCC Course of DOEACC society.

    The Institute has around 1200 books on computers in its

    Library and this number is increasing day by day. It currently has

    approximately 100 studetns of different courses on its roll. The

    institute issues a fix number of books to the students for the entire

    session. Now This Library has one more addition i.e. now it is fully

    computerized.

    47

  • 8/8/2019 Dharender Jangra

    48/125

    R EFERENCE

    1. Object Oriented Programming in C++ by

    Robert Lafore

    2. Object Oriented Programming by E.

    Balaguruswami

    3. Let us C++ by Yeshwant Kanitkar

    4. Complete Reference C++ by Herbert Shildt

    5. System Analsis and Design by E. Awad

    SOFT COPY OF THE PROJECT IN C.D

    1. A Compact Disk containg soft copy of the project is being attached

    herewith.

    48

  • 8/8/2019 Dharender Jangra

    49/125

    CODING

    // Declaration of header files

    #include #include

    #include

    #include

    49

  • 8/8/2019 Dharender Jangra

    50/125

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    typedef char option[15];

    const int ROW = 10,COL = 10;

    int scan; // To hold the special characters for moving the prompt in

    menu

    int ascii;

    // To display the main menu options

    option a[]= {

    "NewAccount",

    "ListofAccounts",

    "IndAccount",

    "DailyTrans",

    "MonthlyReport",

    "EditAccount",

    "Exit"};

    50

  • 8/8/2019 Dharender Jangra

    51/125

    // Displays the modify menu options

    option b[] = {

    "Modify Account",

    "Closeaccount",

    "Quit"

    };

    // Function used to do screening

    class main_menu

    {

    int i,done;

    public:

    void normalvideo(int x,int y,char *str);void reversevideo(int x,int y,char *str);

    void box(int x1,int y1,int x2,int y2);

    char menu();

    void control_menu();

    char e_menu();

    void edit_menu();void help(void);

    };

    51

  • 8/8/2019 Dharender Jangra

    52/125

    /* Class member functions for drawing boxes */

    class shape

    {

    public:

    void line_hor(int, int, int, char);

    void line_ver(int, int, int, char);

    void box(int, int, int, int, char);

    };

    // Class contains the initial deposit of customers

    class initial

    {

    public:

    void add_to_file(int, char t_name[30], char t_address[30],float); // For initial deposits in customers account

    void display_list(void); // Displaying customers account list

    void delete_account(int); // Deleting customers account

    void update_balance(int, char t_name[30], char

    t_address[30], float); // For updating the customer account

    void modify(void); // To modify the customer accountinformation

    int last_accno(void); // To know the last account number

    52

  • 8/8/2019 Dharender Jangra

    53/125

    int found_account(int); // To found the account is in

    "INITIAL.dat" or not

    char *return_name(int); // Function for validation entry of

    customer name

    char *return_address(int); // Function for validation entry of

    customer address

    float give_balance(int); // To print the balance amount of a

    particular customer

    int recordno(int);

    void display(int); // To display the customer account

    private:

    void modify_account(int, char t_name[30], char

    t_address[30]); // Function to modify the customer account

    int accno;

    char name[30], address[30];

    float balance;

    };

    // Class contains the customers daily transaction entry

    class account

    {

    public:

    53

  • 8/8/2019 Dharender Jangra

    54/125

    void new_account(void); // Function to create a new account

    void close_account(void); // Function to close an account

    void display_account(void); // Function to display the

    accounts

    void transaction(void); // To display the transaction process

    void clear(int, int); // Function to perform a clear screen

    function

    void month_report(void); // Function to list monthWise

    transaction report

    private:

    void add_to_file(int, int, int, int, char, char t_type[10], float,

    float, float); // Function to add transaction records

    void delete_account(int); // Function to delete a transaction

    record

    int no_of_days(int, int, int, int, int, int); // Function to find

    the total days

    float calculate_interest(int, float); // Function for calculating

    interest of an account

    void display(int); // Function to display a transaction account

    void box_for_display(int); // Function for displaying box

    int accno;

    char type[10]; // Account type as Cheque or Cash

    int dd, mm, yy; // To store the system date/ Enter date

    54

  • 8/8/2019 Dharender Jangra

    55/125

    char tran; // As the account type is Deposit or

    Withdraw

    float interest, amount, balance;

    };

    // Function to displays all the menu prompt messages from the pointer

    array of option a[]

    void main_menu::normalvideo(int x,int y,char *str)

    {

    gotoxy(x,y);

    cprintf("%s",str);

    }

    // Function to move the cursor on the menu prompt with a reverse video

    color

    void main_menu::reversevideo(int x,int y,char *str)

    {

    textcolor(5+143);

    textbackground(WHITE);

    gotoxy(x,y);

    cprintf("%s",str);

    textcolor(GREEN);

    textbackground(BLACK);

    }

    55

  • 8/8/2019 Dharender Jangra

    56/125

    void main_menu::box(int x1,int y1,int x2,int y2)

    {

    for(int col=x1;col

  • 8/8/2019 Dharender Jangra

    57/125

    }

    char main_menu::menu()

    {

    clrscr();

    textcolor(22);

    box(20, 6, 65, 20);

    box(18, 4, 67, 22);

    textcolor(5+143);

    gotoxy(36, 5);

    textbackground(BLUE);

    cprintf("B A N K I N G");

    textbackground(BLACK);

    textcolor(22);

    for(i = 1; i < 7; i++)

    normalvideo(32, i+10, a[i]);

    reversevideo(32, 10, a[0]);

    i = done = 0;

    _setcursortype(_NOCURSOR);

    do

    {

    int key = getch();

    switch (key)

    {

    57

  • 8/8/2019 Dharender Jangra

    58/125

    case 00:

    key = getch();

    switch (key)

    {

    case 72:

    normalvideo(32, i+10, a[i]);

    i--;

    if (i == -1)

    i = 6;

    reversevideo(32,i+10,a[i]);

    break;

    case 80:

    normalvideo(32, i+10, a[i]);

    i++;

    if (i == 7)

    i = 0;

    reversevideo(32, i+10, a[i]);

    break;

    }

    break;

    case 13:

    done = 1;

    }

    }

    while (!done);

    58

  • 8/8/2019 Dharender Jangra

    59/125

    _setcursortype(_NOCURSOR);

    return(i+49);

    }

    /* The function main_menu() is used to display the main menu of

    banking system */

    void main_menu::control_menu()

    {

    char choice;

    account a;

    do

    {

    choice = menu();

    clrscr();

    switch (choice)

    {

    case '1':

    _setcursortype(_NORMALCURSOR);

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    a.new_account(); // New account member

    function

    59

  • 8/8/2019 Dharender Jangra

    60/125

    break;

    case '2':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    initial ini;

    ini.display_list(); // Glogal list of account

    function

    break;

    case '3':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    _setcursortype(_NORMALCURSOR);

    a.display_account(); // Displaying individual

    accounts all transactions

    break;

    case '4':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    account a;

    _setcursortype(_NORMALCURSOR);

    a.transaction(); // Daily transaction for individual

    account

    break;

    60

  • 8/8/2019 Dharender Jangra

    61/125

    case '5':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    _setcursortype(_NORMALCURSOR);

    a.month_report(); // Monthly report for any

    account

    break;

    case '6':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    gotoxy(10,10);

    edit_menu(); // Sub menu for modifying or

    deleting any account

    break;

    case '7' :exit(0);

    }

    } while (choice != 6);

    }

    /* This function is used to return the cursor position to the edit menu

    function where the

    menu prompt will valid */

    char main_menu::e_menu()

    61

  • 8/8/2019 Dharender Jangra

    62/125

    {

    clrscr();

    textcolor(22);

    box(25,6,60,15);

    box(23,4,62,17);

    textcolor(5+143);

    gotoxy(34,5);

    textbackground(GREEN);

    cprintf("E D I T - M E N U");

    textcolor(22);

    textbackground(BLACK);

    for (i = 1;i < 3; i++)

    normalvideo(32, i+10, b[i]);

    reversevideo(32, 10, b[0]);

    i = done = 0;

    _setcursortype(_NOCURSOR);

    do

    {

    int key = getch();

    switch (key)

    {

    62

  • 8/8/2019 Dharender Jangra

    63/125

    case 00:

    key = getch();

    switch (key)

    {

    case 72:

    normalvideo(32, i+10, b[i]);

    i--;

    if (i == -1)

    i = 2;

    reversevideo(32, i+10, b[i]);

    break;

    case 80:

    normalvideo(32, i+10, b[i]);

    i++;

    if (i == 3)

    i=0;

    reversevideo(32, i+10, b[i]);

    break;

    }

    break;

    case 13:

    done = 1;

    }

    }

    while (!done);

    63

  • 8/8/2019 Dharender Jangra

    64/125

    _setcursortype(_NOCURSOR);

    return(i+49);

    }

    /* Function for edit menu with account modification and close */

    void main_menu::edit_menu()

    {

    char choice;

    account a;

    do

    {

    choice = e_menu();

    clrscr();

    switch (choice)

    {

    case '1':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    initial ini;

    _setcursortype(_NORMALCURSOR);

    ini.modify();

    break;

    64

  • 8/8/2019 Dharender Jangra

    65/125

    case '2':

    box(3, 1, 75, 24);

    box(5, 2, 73, 23);

    account a;

    _setcursortype(_NORMALCURSOR);

    a.close_account();

    break;

    case '3':

    return;

    }

    } while (choice != 6);

    }

    /* Function to draw horizontal line */

    void shape::line_hor(int column1, int column2, int row, char c)

    {

    for (column1; column1

  • 8/8/2019 Dharender Jangra

    66/125

    {

    for (row1; row1

  • 8/8/2019 Dharender Jangra

    67/125

    c1 = c;

    c2 = c;

    c3 = c;

    c4 = c;

    l1 = c;

    c2 = c;

    }

    gotoxy(column1, row1);

    cout

  • 8/8/2019 Dharender Jangra

    68/125

    }

    /* Function to display help about this project */

    void main_menu::help(void)

    {

    clrscr();

    setbkcolor(7);

    settextstyle(7,HORIZ_DIR,5);

    outtextxy(70,20,"Welcome to Banking Project");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(10,70,"********************* PRESENTED BY

    -SUSHIL KUMAR GOYAL *********************");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(60,100, "This project your can keep record of daily

    banking transaction");

    delay(2);

    outtextxy(60,130, "This program is capable of holding any no. of

    account.");

    delay(2);

    outtextxy(60,160, "-In first option you can open new account");

    delay(2);

    outtextxy(60,190, "-In second option you can see the list of all the

    accounts");

    68

  • 8/8/2019 Dharender Jangra

    69/125

    delay(2);

    outtextxy(60,220,"-In third option you can see all the transaction of

    individual account");

    delay(2);

    outtextxy(60,250, "-Through fourth optiion you can do banking

    transactions");

    delay(2);

    outtextxy(60,280, "(Deposit/Withdraw)");

    delay(2);

    outtextxy(60,310, "-In fifth option you can take monthWise

    individual account report");

    delay(2);

    outtextxy(60,340,"-In sixth option you can modify or delete any

    account");

    delay(2);

    outtextxy(60,370, "Note-: Opening amount should not less that Rs.

    500/-");

    delay(2);

    outtextxy(60,400, "-And last option is Quit (Exit to Window)");

    delay(2);

    settextstyle(7,HORIZ_DIR,4);

    outtextxy(80,420,"Press any key to continue...");

    getch();

    69

  • 8/8/2019 Dharender Jangra

    70/125

    }

    /* Function for modifying the existing accounts */

    void initial::modify(void)

    {

    clrscr();

    int j;

    char t_acc[10];

    int t, t_accno;

    gotoxy(17, 1);

    cout

  • 8/8/2019 Dharender Jangra

    71/125

    }

    gotoxy(71, 1);

    cout

  • 8/8/2019 Dharender Jangra

    72/125

    do

    {

    a.clear(5, 13);

    gotoxy(5, 13);

    cout

  • 8/8/2019 Dharender Jangra

    73/125

    valid = 1;

    gotoxy(15, 15);

    gets(t_name);

    strupr(t_name);

    if (t_name[0] == '0')

    return;

    if (strlen(t_name) > 25)

    {

    valid = 0;

    gotoxy(5, 23);

    cprintf("\7Name should not greater than 25");

    getch();

    }

    } while (!valid);

    do

    {

    a.clear(15, 16);

    a.clear(5, 23);

    gotoxy(5, 23);

    cout

  • 8/8/2019 Dharender Jangra

    74/125

    if (t_address[0] == '0')

    return;

    if (strlen(t_address) > 25)

    {

    valid = 0;

    gotoxy(5, 23);

    cprintf("\7Address should not greater than 25");

    getch();

    }

    }while (!valid);

    if (strlen(t_address) > 0)

    modified = 1;

    if (!modified)

    return;

    // clears the screen at 23rd row and from 5th column

    a.clear(5,23);

    do

    {

    a.clear(5, 23);

    gotoxy(5, 18);

    cout

  • 8/8/2019 Dharender Jangra

    75/125

    return;

    ch = toupper(ch);

    }while (ch != 'N' && ch != 'Y');

    if (ch == 'N')

    return;

    // Passes the parameter to add in data file

    modify_account(t_accno, t_name, t_address);

    gotoxy(5, 21);

    cout

  • 8/8/2019 Dharender Jangra

    76/125

    while (file.read((char *)this, sizeof(initial)))

    {

    if (t_accno == accno)

    {

    gotoxy(8, 5);

    cout

  • 8/8/2019 Dharender Jangra

    77/125

    }

    file.close();

    }

    /* Function for updating the modified account into INITIAL.dat file */

    void initial::modify_account(int t_accno, char t_name[30], char

    t_address[30])

    {

    int recno;

    recno = recordno(t_accno);

    fstream file;

    file.open("INITIAL.dat", ios::out|ios::ate);

    strcpy(name, t_name);

    strcpy(address, t_address);

    int location;

    // finds the position in data file

    location = (recno-1) * sizeof(initial);

    file.seekp(location);

    // Overwrites the modified record into INITIAL.dat data file

    file.write((char *)this, sizeof(initial));

    file.close();

    return;

    }

    77

  • 8/8/2019 Dharender Jangra

    78/125

    /* Function to find the last account number */

    int initial::last_accno(void)

    {

    fstream file;

    file.open("INITIAL.dat", ios::in);

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

    int count = 0;

    // Founds the last account no.

    while (file.read((char *)this, sizeof(initial)))

    count = accno;

    file.close();

    return count;

    }

    /* This function add_to_file() is used to create new/fresh record in the

    data file */

    void initial::add_to_file(int t_accno, char t_name[30], char t_address[30],

    float t_balance)

    {

    accno = t_accno;

    strcpy(name, t_name);

    strcpy(address, t_address);

    balance = t_balance;

    78

  • 8/8/2019 Dharender Jangra

    79/125

    fstream file;

    // Appends new account record with the balance into INITIAL.dat

    data file

    file.open("INITIAL.dat", ios::out|ios::app);

    file.write((char *)this, sizeof(initial));

    file.close();

    }

    // Function for deleting a account from INITIAL.dat file

    void initial::delete_account(int t_accno)

    {

    fstream file;

    file.open("INITIAL.dat", ios::in);

    fstream temp;

    temp.open("TEMP.dat", ios::out);

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

    // Uses a copy method to delete the account from INTITAL.dat

    data file

    while (!file.eof())

    {

    file.read((char *)this, sizeof(initial));

    if (file.eof())

    break;

    79

  • 8/8/2019 Dharender Jangra

    80/125

    if (accno != t_accno)

    temp.write((char *)this, sizeof(initial));

    }

    file.close();

    temp.close();

    file.open("INITIAL.dat", ios::out);

    temp.open("TEMP.dat", ios::in);

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

    // Copy the TEMP.dat contents into INTITAL.dat data file

    while (!temp.eof())

    {

    temp.read((char *)this, sizeof(initial));

    if (temp.eof())

    break;

    if (accno != t_accno)

    file.write((char *)this, sizeof(initial));

    }

    file.close();

    temp.close();

    }

    /* Function for add an account details of daily tranaction into

    BANKING.dat file. */

    80

  • 8/8/2019 Dharender Jangra

    81/125

    void account::add_to_file(int t_accno, int d1, int m1, int y1, char t_tran,

    char t_type[10], float t_interest, float t_amount, float t_balance)

    {

    fstream file;

    file.open("BANKING.dat", ios::app);

    accno = t_accno;

    getch();

    dd = d1;

    mm = m1;

    yy = y1;

    tran = t_tran;

    strcpy(type, t_type);

    interest = t_interest;

    amount = t_amount;

    balance = t_balance;

    // Appends the transaction record into BANKING.dat data file

    file.write((char *)this, sizeof(account));

    file.close();

    }

    /* Function for deleting an account from BANKING.dat file. */

    void account::delete_account(int t_accno)

    {

    fstream file;

    81

  • 8/8/2019 Dharender Jangra

    82/125

    file.open("BANKING.dat", ios::in); // Open to read records

    fstream temp;

    temp.open("TEMP.dat", ios::out); // Open to write records

    file.seekg(0, ios::beg); // Positioned from begining of the file

    // Uses the copy method for deleting the transaction record from

    BANKING.dat data file

    while (!file.eof())

    {

    file.read((char *)this, sizeof(account));

    if (file.eof())

    break;

    if (accno != t_accno)

    temp.write((char *)this, sizeof(account));

    }

    file.close();

    temp.close();

    file.open("BANKING.dat", ios::out);

    temp.open("TEMP.dat", ios::in);

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

    // Uses copy method to transfer the record from TEMP.dat file to

    BANKING.dat data file

    while (!temp.eof())

    {

    82

  • 8/8/2019 Dharender Jangra

    83/125

    temp.read((char *)this, sizeof(account));

    if (temp.eof())

    break;

    if (accno != t_accno)

    file.write((char *)this, sizeof(account));

    }

    file.close();

    temp.close();

    }

    /* Function for displaying an account from "INITIAL.dat". */

    void initial::display_list(void)

    {

    clrscr();

    int flag;

    float t_bal = 0.0;

    fstream file;

    gotoxy(25,2);

    cout

  • 8/8/2019 Dharender Jangra

    84/125

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    gotoxy(62, 3);

    cout

  • 8/8/2019 Dharender Jangra

    85/125

    while (file.read((char *)this, sizeof(initial)))

    {

    flag = 0;

    delay(2);

    gotoxy(3, row);

    cout

  • 8/8/2019 Dharender Jangra

    86/125

    cout

  • 8/8/2019 Dharender Jangra

    87/125

    cout

  • 8/8/2019 Dharender Jangra

    88/125

    {

    if (accno == t_accno)

    {

    found = 1;

    break;

    }

    }

    file.close();

    return found;

    }

    /* Function for return name of the account holder from INITIAL.dat. */

    char *initial::return_name(int t_accno)

    {

    fstream file;

    file.open("INITIAL.dat", ios::in);

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

    char t_name[30];

    // Return the name to display at report screen if found

    while (file.read((char *)this, sizeof(initial)))

    {

    if (accno == t_accno)

    {

    strcpy(t_name, name);

    88

  • 8/8/2019 Dharender Jangra

    89/125

  • 8/8/2019 Dharender Jangra

    90/125

    file.close();

    return t_address;

    }

    /* Function for display account details */

    void account::box_for_display(int t_accno)

    {

    int d1, m1, y1;

    struct date d;

    getdate(&d);

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    gotoxy(63, 2);

    cout

  • 8/8/2019 Dharender Jangra

    91/125

    gotoxy(25, 2);

    cout

  • 8/8/2019 Dharender Jangra

    92/125

    {

    clrscr();

    char t_acc[10];

    int j;

    int tamt = 0, damt = 0, wamt = 0;

    int t, t_accno;

    gotoxy(71, 1);

    cout

  • 8/8/2019 Dharender Jangra

    93/125

    // Display the heading from this function

    box_for_display(t_accno);

    int row = 9, flag;

    fstream file;

    file.open("BANKING.dat", ios::in);

    while (file.read((char *)this, sizeof(account)))

    {

    if (accno == t_accno)

    {

    flag = 0;

    delay(2);

    gotoxy(4, row);

    cout

  • 8/8/2019 Dharender Jangra

    94/125

    tamt = tamt - amount;

    gotoxy(42, row);

    }

    cout

  • 8/8/2019 Dharender Jangra

    95/125

    cout

  • 8/8/2019 Dharender Jangra

    96/125

  • 8/8/2019 Dharender Jangra

    97/125

    cout > dd1;

    gotoxy(40, 5);

    cout > mm1;

    gotoxy(43, 5);

    cout > yy1;

    clrscr();

    char t_acc[10];

    int j;

    int tamt = 0, damt = 0, wamt = 0;

    int t, t_accno;

    gotoxy(71, 1);

    cout

  • 8/8/2019 Dharender Jangra

    98/125

    clrscr();

    initial ini;

    if (!ini.found_account(t_accno))

    {

    gotoxy(5, 5);

    cout

  • 8/8/2019 Dharender Jangra

    99/125

    if ((accno == t_accno) && ((mm < mm1 && yy

  • 8/8/2019 Dharender Jangra

    100/125

    flag = 0;

    delay(2);

    gotoxy(4, row);

    cout

  • 8/8/2019 Dharender Jangra

    101/125

    gotoxy(66, row);

    cout

  • 8/8/2019 Dharender Jangra

    102/125

    for (j = 1; j

  • 8/8/2019 Dharender Jangra

    103/125

    gotoxy(66, row);

    tamt = tamt + pre_balance;

    // Balance amount

    cout

  • 8/8/2019 Dharender Jangra

    104/125

    initial ini;

    shape s;

    s.box(2, 1, 79, 25, 218);

    s.box(25, 2, 54, 4, 219);

    gotoxy(65, 2);

    cout

  • 8/8/2019 Dharender Jangra

    105/125

    t_accno = ini.last_accno();

    t_accno++;

    // Appends and deletes a false record to create primary position in

    data files

    if (t_accno == 1)

    {

    ini.add_to_file(t_accno, "abc", "xyz", 1.1);

    ini.delete_account(t_accno);

    cout

  • 8/8/2019 Dharender Jangra

    106/125

    gotoxy(5, 12);

    cout

  • 8/8/2019 Dharender Jangra

    107/125

    do

    {

    clear(25, 15);

    clear(5, 23);

    gotoxy(5, 23);

    cout 25)

    {

    valid = 0;

    gotoxy(5, 23);

    cprintf("\7Address should not greater than 25");

    getch();

    }

    }while (!valid);

    do

    {

    char vari[30];

    107

  • 8/8/2019 Dharender Jangra

    108/125

    clear(13, 12);

    clear(5, 23);

    gotoxy(5, 23);

    cout 25)

    {

    valid = 0;

    gotoxy(5, 23);

    cprintf("Should not blank or greater than 25");

    getch();

    }

    }while (!valid);

    do

    {

    clear(13, 12);

    clear(5, 23);

    gotoxy(5, 23);

    cout

  • 8/8/2019 Dharender Jangra

    109/125

    valid = 1;

    gotoxy(23, 14);

    gets(t);

    t_bal = atof(t);

    t_balance = t_bal;

    if (t[0] == '0')

    {

    valid = 0;

    gotoxy(5, 23);

    cprintf("\7Should not less than 500");

    getch();

    }

    }while (!valid);

    clear(5, 23);

    do

    {

    clear(5, 17);

    valid = 1;

    gotoxy(5, 17);

    cout

  • 8/8/2019 Dharender Jangra

    110/125

    }while (ch != 'N' && ch != 'Y');

    if (ch == 'N')

    return;

    float t_amount, t_interest;

    t_amount = t_balance;

    t_interest = 0.0;

    char t_tran, t_type[10];

    t_tran = 'D';

    strcpy(t_type, "INITIAL");

    // Appends the records contents into both INITIAL.dat and

    BANKING.dat data files

    ini.add_to_file(t_accno, t_name, t_address, t_balance);

    add_to_file(t_accno, d1, m1, y1, t_tran, t_type, t_interest,

    t_amount, t_balance);

    }

    /* Function for returning balance amount of an account. */

    float initial::give_balance(int t_accno)

    {

    fstream file;

    file.open("INITIAL.dat", ios::in);

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

    float t_balance;

    110

  • 8/8/2019 Dharender Jangra

    111/125

    // Gives the last balance of an individual account

    while (file.read((char *)this, sizeof(initial)))

    {

    if (accno == t_accno)

    {

    t_balance = balance;

    break;

    }

    }

    file.close();

    return t_balance;

    }

    /* Function for returning the record no. for updating balance */

    int initial::recordno(int t_accno)

    {

    fstream file;

    file.open("INITIAL.dat", ios::in);

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

    int count = 0;

    // Finds the record position in INITIAL.dat data file

    while (file.read((char *)this, sizeof(initial)))

    {

    111

  • 8/8/2019 Dharender Jangra

    112/125

    count++;

    if (t_accno == accno)

    break;

    }

    file.close();

    return count;

    }

    /* Function for updating the balance for the given account no. */

    void initial::update_balance(int t_accno, char t_name[30], char

    t_address[30], float t_balance)

    {

    int recno;

    recno = recordno(t_accno);

    fstream file;

    file.open("INITIAL.dat", ios::out|ios::ate);

    strcpy(name, t_name);

    strcpy(address, t_address);

    balance = t_balance;

    int location;

    location = (recno-1) * sizeof(initial); // Find the location in file

    file.seekp(location); // Searches the insertion position in data

    file

    // Updates the balance amount in INITIAL.dat data file

    112

  • 8/8/2019 Dharender Jangra

    113/125

    file.write((char *)this, sizeof(initial));

    file.close();

    }

    /* Function to return no. days between two dates. */

    int account::no_of_days(int d1, int m1, int y1, int d2, int m2, int y2)

    {

    static int month[] = {31, 28, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30};

    int days = 0;

    while (d1 != d2 || m1 != m2 || y1 != y2)

    {

    days++;

    d1++;

    if (d1 > month[m1-1])

    {

    d1 = 1;

    m1++;

    }

    if (m1 > m2)

    {

    m1 = 1;

    y1++;

    }

    }

    return days;

    113

  • 8/8/2019 Dharender Jangra

    114/125

    }

    /* Function for calculates interest */

    float account::calculate_interest(int t_accno, float t_balance)

    {

    fstream file;

    file.open("BANKING.dat", ios::in);

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

    int d1, m1, y1, days;

    while (file.read((char *)this, sizeof(account)))

    {

    if (accno == t_accno)

    {

    d1 = dd;

    m1 = mm;

    y1 = yy;

    break;

    }

    }

    int d2, m2, y2;

    struct date d;

    getdate(&d);

    d2 = d.da_day;

    m2 = d.da_mon;

    y2 = d.da_year;

    114

  • 8/8/2019 Dharender Jangra

    115/125

    float t_interest = 0.0;

    if ((y2 < y1) || (y2 == y1 && m2 < m1) || (y2 == y1 && m2 ==

    m1) && (d2 < d1))

    return t_interest;

    days = no_of_days(d1, m1, y1, d2, m2, y2);

    int months = 0;

    if (days > 30)

    {

    months = days / 30;

    t_interest = ((t_balance*2)/100 * months);

    }

    file.close();

    return t_interest;

    }

    /* Function for making daily transaction (Deposit 'D'/Withdraw 'W'. */

    void account::transaction(void)

    {

    clrscr();

    char t_acc[10];

    int t, t_accno, valid;

    gotoxy(71,1);

    cout

  • 8/8/2019 Dharender Jangra

    116/125

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

    if (t_accno == 0)

    return;

    clrscr();

    initial ini;

    if (!ini.found_account(t_accno))

    {

    gotoxy(5, 5);

    cout

  • 8/8/2019 Dharender Jangra

    117/125

    textbackground(BLACK);

    int d1, m1, y1;

    struct date d;

    getdate(&d);

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    gotoxy(5, 6);

    cout

  • 8/8/2019 Dharender Jangra

    118/125

  • 8/8/2019 Dharender Jangra

    119/125

    cout

  • 8/8/2019 Dharender Jangra

    120/125

    gotoxy(5, 21);

    cout t_balance) || (t_amount