atm (shiv kumar)

Upload: amit-verma

Post on 06-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Atm (Shiv Kumar)

    1/122

    A

    Project Report

    On

    ATUOMATIC TELLER MACHINE

    [ATM]

    (Submitted in partial fulfillment of the requirement of

    Master of Computer Applicaton, Distance Education,

    Guru Jambheshwar University of Science & Technology, Hisar)

    Research Supervisor: Submitted By:

    Miss Rajni Shiv KumarMCA Faculty in Enrollment No.09031137016

    Leads International Institute MCA 3rd year

    Of Engg. & Tech., Karnal

    (Session 2011-12)

    Directorate of Distance Education

    Guru Jambheshwar University of Science & Technology

    Hisar125001- (India)

  • 8/2/2019 Atm (Shiv Kumar)

    2/122

    ACKNOWLEDGEMENT

    The submission of this project report gives me an opportunity to convey my gratitude to

    all those who have helped me reach a stage where I have immense confidence to launch

    my career in the competitive world of information technology.

    I have no second thought in admitting that it is my respected teachers who have played

    the most significant role in shaping my career and I would be miserably failing in my

    duty if I dont extend my heart filled gratitude to them.

    First and foremost, I would like to express my profound gratitude and sincere

    acknowledgements to MISS RAJNI ( MCA Faculty in Computer Science &

    Application) who have been a source of perpetual inspiration to me, gently guiding and

    paving my way towards a bright career, throughout my project I was very fortunate to

    have them as my project guide also. They were willing to give all kind of support and

    encouragement. Their parental kind of love that they extends towards every student in the

    department and the concern they show has left an indelible impression on me.

    My special thanks to Mr. Amit Sandhu (Director of Leads international institute

    of Engineering & technology, Karnal.) for providing these facilities in the department.

    This letter of thanks would be incomplete if I missed out the mention of my friends & my

    family members. I am very thankful to my parents which have been a constant source of

    inspiration for me from the very starting of my life..

    Shiv Kumar

  • 8/2/2019 Atm (Shiv Kumar)

    3/122

    Roll No.-09031137016

    MCA 3rd year

    CERTIFICATE

    To whom it may concern

    This is to be certified that Mr. Shiv Kumar is a student of MCA 3rd year has completed

    his project on Automatic Teller Machine System under my supervision.

    He is very sincere and hard working.

    I wish him success in life.

    Mr. Amit Sandhu Miss Rajni

    Director Faculty of MCA

    Leads International Institute Leads International Institute

    Of Engineering & Technology, Of Engineering & Technology,

    Karnal. Karnal.

  • 8/2/2019 Atm (Shiv Kumar)

    4/122

    CONTENTS

    INTRODUCTION OF THE PROJECT

    OPERATION REQUIREMENTS

    HARDWARE

    SOFTWARE

    INSTALLATION

    EXISTING SYSTEM

    PROPOSED SYSTEM

    SYSTEM ANALYSIS

    FEASIBILITY STUDY

    SYSTEM DESIGN

    INPUT / OUTPUT DESIGN

    FILE DESIGN

    CODING

    OUTPUTS

    MERITS OF THE PROJECT

    DEMERITS OF THE PROJECT

    FURTHER SCOPE OF THE PROJECT

    BIBLIOGRAPHY

  • 8/2/2019 Atm (Shiv Kumar)

    5/122

    INTRODUCTION TO PROJECT

    This project on Automatic Teller Machine (ATM) aims at quick storage and

    retrieval of money and funds. It gives 24 hrs. service i.e. it works round the clock. It is

    very easy to use and moreover it saves time. This project offers user to enter the data

    through simple and interactive forms. Through all these features it increases the

    efficiency and accuracy of the Banking system.

    The software project management process begins with a set of activities that are

    collectively called project planning. The first of these activities is estimation. The second

    task of estimation of resources required accomplish the software development effort.

    The objective of software project planning is to provide a framework that enables

    a manager to make reasonable estimates of the resources, cost and schedule. The project

    planning took into account the following phases:

    ANALYSIS PHASE

    It includes the study of problems. It also involves the study of various tools

    required for implementing the problems. Moreover it includes information about the new

    system, which is to be developed and how that system will solves the problems.

  • 8/2/2019 Atm (Shiv Kumar)

    6/122

    DESIGN PHASE:

    Design phase of the project demand that we first specify a structured design with

    an initial design document and in the second step, prepare a detailed design. Specify the

    functional modules and functional refinement.

    CODING PHASE :

    This phase of the project requires design of the system developed in the design

    phase of the project to be coded.

    TESTING PHASE & INTEGRATION PHASE :

    Testing phase includes the conformance of the acceptance criteria set down in the

    customer requirements specification. Integration Phase required the integration of the

    various modules in the project implementation phase into the main project module.

  • 8/2/2019 Atm (Shiv Kumar)

    7/122

    OPERATIONAL REQUIREMENT

    In order to run this project of ATM developed under C++ your computer should meet the

    following Hardware & Software requirements:

    Installation Guide

    HARDWARE REQUIREMENT

    At least 64MB RAM preferred

    Hard disk of Size 8 GB or above

    SVGA Card

    Monitor Mono VGA/ Colour SVGA ( Proffered)

    Mouse

    Keyboard

    HDD

    CD Drive

    SOFTWARE REQUIREMENT

    Operating System : Windows 9x or Windows NT

    MS-Office- 97 or above

    C++

  • 8/2/2019 Atm (Shiv Kumar)

    8/122

    INSTALLATIONS STEPS

    Insert the Floppy having the project in the respective disk drive

    Create a new directory on the hard disk

    Copy. Exe file into this directory

    Run the exe file

  • 8/2/2019 Atm (Shiv Kumar)

    9/122

    PROJECT PLANNING

    The software project management process begins with a set of activities that are

    collectively called project planning. The first of these activities is estimation. The second

    task of estimation of resources required accomplish the software development effort.

    The objective of software project planning is to provide a framework that enables

    a manager to make reasonable estimates of the resources, cost and schedule. The project

    planning took into account the following phases:

    ANALYSIS PHASE

    It includes the study of problems. It also involves the study of various tools

    required for implementing the problems. Moreover it includes information about the new

    system, which is to be developed and how that system will solves the problems.

    DESIGN PHASE:

    Design phase of the project demand that we first specify a structured design with

    an initial design document and in the second step, prepare a detailed design. Specify the

    functional modules and functional refinement.

    CODING PHASE :

    This phase of the project requires design of the system developed in the design

    phase of the project to be coded.

  • 8/2/2019 Atm (Shiv Kumar)

    10/122

    TESTING PHASE & INTEGRATION PHASE :

    Testing phase includes the conformance of the acceptance criteria set down in the

    customer requirements specification. Integration Phase required the integration of the

    various modules in the project implementation phase into the main project module.

  • 8/2/2019 Atm (Shiv Kumar)

    11/122

    INTRODUCTION TO C++

    C++ an Object Oriented Programming

    Object-Oriented Programming (OOP) is the most dramatic innovation in Software

    development in the last decade it ranks in importance with the development of the first

    higher-level language at the dawn of the Computer age sooner or later every programmer

    will be affected by the Object-Oriented approach to program design. C++ or Object-

    Oriented Programming language is an extension of C language that is widely used on

    many machines. C++ is an Object Oriented Programming language initially named C

    with classes. Bjarne Stroustrupt at AT&T Bell laboratories in Murry Hill, New Jersey,

    developed C++ USA in the early eighties. It is a powerful modern language that

    combines the power, elegance and flexibility of C.

    Stroustrup, an admirer of Simula 67 and a strong supporter of C, wanted to combine the

    best of both languages and create a more powerful languages that could support Object

    Oriented Programming features and still retain the power of C.

  • 8/2/2019 Atm (Shiv Kumar)

    12/122

    GRAPHICS USED

    All modes are fundamentally of two types:

    1. Text

    2. Graphics

    Some modes display only takes, some sport more number of colors whereas some

    are made only four graphics.

    As seen earlier, the display adapter continuously dumps the contents of video

    memory on the screen. Most text modes use B Block in the memory map.

    Whereas most graphics used A block.

    The amount of memory required to represent character on the screen in text mode

    and pixel in graphics mode various from mode to mode.

    Following are the graphics used in the ATM software.

    Initgraph- Initialises the graphics style.

    Void for initgraph (int far * graph driver, int far * graphmode, char far * path to

    driver) ;

    Settextstyle- Set the current text characteristics.

    Void far settextstyle (int font, int direction, int char size);

    Outtextstyle- Displays a string at the specified location.

    Void far outtextstyle (int x, int y char far * text string);

    Setcolor- Set the current fore groundcolor using the palette.

    Void far setcolor (int, color);

    Setbkcolor- Sets the current background color using the palette.

    Void far setbkcolor (int color);

  • 8/2/2019 Atm (Shiv Kumar)

    13/122

    SYSTEM ANALYSIS

    System Analysis is the process of gathering and interpreting fact, diagnose the

    problem, and use the information to recommend improvements to the system. More

    specifically Analysis specifies what the system should do Design specifies how to

    accomplish the object.

    After finding out that there are a lot of problems in the manual system as it is very

    complicated and lengthy process, I analysed all the problems and find out the solution as

    per required. Valuation Accounting System is very fast process and its all the problems of

    the existing system according to the requirements

  • 8/2/2019 Atm (Shiv Kumar)

    14/122

    FEASIBILITY ANALYSIS

    An initial investigation culminates in a proposal that determines whether an alternative

    system is feasible. The feasibility study describes and evaluates Valuation Accounting

    System and provides for the selection of the best system that meets system performance

    requirements.

    To do a feasibility study, we need to consider the economic, technical, and

    behavioral factor in system development. First a project team is formed. The team

    develops system flowcharts that identify the characteristics of Valuation Accounting

    System, evaluate the performance of each system, weight system performance and cost

    data, and select the best Valuation Accounting System for the job.

    Three key considerations are involved in the feasibility analysis: economic,

    technical, and behavioral

    Economic Feasibility

    Economic analysis is the most frequently used method for evaluating the effectiveness of

    a Valuation Accounting System. More commonly known as cost/benefit analysis, the

    procedure is to determine the benefits and savings that are expected from a Valuation

    Accounting System and compare them with costs. Banking system benefits out weighted

    costs, so the system is made to design and implement the system. So, we dont need

    further justification or alterations in the proposed system.

    Technical Feasibility

    Technical Feasibility centers on the existing computer system (hardware, software, etc.)

    and to what extent it can support the proposed system. In our case if Valuation

    Accounting System is running on a computer then it uses 10% of the CPU capacity. So

    we can run multiple instances of Valuation Accounting System on a single computer.

  • 8/2/2019 Atm (Shiv Kumar)

    15/122

    This system doesnt require additional hardware. If the budget is serious constraint, then

    this project judged feasible.

    Behavioral Feasibility

    People are inherently resistant to change, and computers have been known to facilitate

    change. An estimate should be made of how strong a reaction the user staff is likely to

    have toward the development of a computerized system. The design of the VA System is

    very easy to understand easily adaptable by the DOT staff. It also includes behavioral

    feasibility

  • 8/2/2019 Atm (Shiv Kumar)

    16/122

    SYSTEM DESIGN

    System designing is a process which has to be rendered by the system analyst he/she

    studies the manual system and the output comes, then he/she designs output graph chart

    for the programmer.

    Besides the analyst has to document the existing system to design the input

    and codes which a programmer use in his programs.

    INPUT DESIGN

    Input design is essential part of this project. It is the explanation part of what we are

    inputting in the computer, which will help us in further processing before starting any

    other processing or before entering any other information.

    The five choices available in front of user for different menus. Open new

    account for open the account of a customer. Daily bank transactions for deposit or

    withdrawal money by cash or cheque. Reports menu to see the different reports of total

    accounts in the bank, particular account number & monthly reports.

    FILE DESIGN

    While reading and writing formatted text files is very easy. It is not always the most

    efficient way to handle files.

    If the file is open in the input mode then only read operation can perform from the

    file and if it is opened in the output mode then data can be only written. Append mode is

    used to add the data at the end of the file.

  • 8/2/2019 Atm (Shiv Kumar)

    17/122

    Notice that write ( ), the functions we have used cin, cout, gets ( ) and puts( ) operates on

    input and output data. That is it treats the data stored in the object as a sequence of bytes

    and makes no assumptions about how these bytes should be handled. By contrast, the

    character-based functions take some liberties with the data. For example they expand the

    \n or endl character into two bytes. A carriage return and a line feed-before storing it to

    disk. It makes the file more readably by dos-based utilities like type.

    The read ( ) and write ( ) functions work in different modes using this pointer so that

    entire objects can be saved to disk. No matter what sort of data they can single objects

    can be stored, as can arrays or other data structures of many objects. Various data files

    used in program which are as following.

    All the above data files contain the different and unique set of questions along with their

    options and the correct answer.

    All the files in the main program are used to take input. So that is open in main program

    in input mode. At time a single file will be open.

    Depending upon the random no. Which is granted on the bases of count system times

    second part. When one file will open all the input will come from that particular file.

    After taking the inputs, file will be closed.

    OUTPUT DESIGN

    Output from computer are required to communicate the results of processing to users.

    The major concern of the user in the system design is always with the output. Therefore,

    the output design must be intangible and impelling. If therefore the output design is poor,

    the entire system development is likely to be jeopardized. Once the output report format

    and content has been fixed the system analyst can work backward and draw the inputs

    and master file layout as also the computation to be performed to device the figure in the

    output report. Going for the back, the system analyst would evolve suitable procedure

  • 8/2/2019 Atm (Shiv Kumar)

    18/122

    and design the forms to capture the input data of the banks.In this all reports of total

    customers, total accounts, monthly reports, single account report of account number can

    be seen.

  • 8/2/2019 Atm (Shiv Kumar)

    19/122

    SYSTEM TESTING

    During system testing the system is used experimentally to ensure that the

    software does not fail i.e. it will run according to specifications and in the way user

    expect. Special test data are input for the processing and the result examined A limited

    number of users may be allowed to use the system so that analyst can see whether they

    use it in unforeseen ways. It is preferable to discover any surprise before the organization

    implements the systems and encounters them later on.

    The norms followed during the testing phase were thoroughly tested by me, the

    developer; I was required to release the source doe. The source code was copied in the

    area of the testers from the area of the developers. Here all the further testing was done. If

    some changes were desired in the program, I was suitably informed and was required to

    make the necessary modification.

    Objectives of Testing :

    Testing is vital to the success of a system. Testing is done at different stages

    within the development phase. System testing makes a logical assumption that if all parts

    of the system are correct the goals will be successfully achieved. Inadequate testing leads

    to errors that may not appear until months later when correction will be extremely

    difficult. Another objective of testing is its utility.

    Following testing procedure were used:

  • 8/2/2019 Atm (Shiv Kumar)

    20/122

    UNIT TESTING

    Unit testing is the testing of a single program module in an isolation environment. The

    testing of the processing procedure is the main focus. In this regard the entire module was

    separately tested first as isolated and complete entities. This help a lot in discovering

    problems related to single module and rectifying them in the context of the module itself,

    rather than considering module related problems in a global context.

    Integration Testing:

    Integration testing is the process of the testing the interfaces among system

    modules. Such testing ensures that data moves between system are intended. In the regard

    of integration testing, it was seen that all the data was expected to be the output of a

    particular module was obtained in the correct format, so that the next module could

    accept it appropriately. This could be done either after the entire system was developed,

    or in stages after more than one module was developed.

    System Testing:

    System testing is the testing of the system against it initial objectives. Such testing is

    done either in a simulated environment or in a live environment.

    In the system, which I developed , the testing was done in a pseudo- real

    environment. The work I was involved dealt with storage and withdrawal of cash. All

    data which being used for transaction can be copied into the system uses in Banks.

    Thus, discovery of the errors became simpler. All the above types testing were

    carried out and various extreme cases were also introduced to check for whether the

    system responded as expected. The various forms, procedures, functions, modules and

    the events were tested to discover they behaved in the manner expected of them and gave

  • 8/2/2019 Atm (Shiv Kumar)

    21/122

    the accurate results. However, the factor, which helped most in the modification and

    rectification of the system, was the user response. The user after using the system would

    invariably come up with some idea to improve the system.

  • 8/2/2019 Atm (Shiv Kumar)

    22/122

    FURTHER SCOPE OF THE PROJECT

    One thing we know that the scope of the project depends upon the need. Everything

    whatever is being made or has already been made is just because of the need. When we

    face a situation in which we require something which is not available with us, we try to

    invent that thing. Similar is the case with our ATM. Before the advent of computer, we

    know that each and every task is being performed under manual systems. It is tedious to

    work in the manual system as than of computer system. One can handle his work very

    effectively, speedily and timely with the help of computer . If the manual system were

    continued today then a person would always be busy with transaction

    of money and funds. ATM solves these problems.

    In short, ATM offer a great deal of comfort. Everything is revolving around the

    mouse button and just a click solves many problems within seconds. No need to maintain

    heavy registers. There is no requirement of keeping big records. Everything is automatic.

    Now we can easily say that the future of the project is quite bright in time.

  • 8/2/2019 Atm (Shiv Kumar)

    23/122

    ADVANTAGES & DISADVANTAGES

    Advantages

    Less time is consumed.

    This project offers user to enter data in simple manner.

    Data storage and retrieval will become faster and easier.

    Transactions can be made with in a fraction of seconds.

    Calculation process becomes easier.

    Modification process becomes easier.

    Through these features it will increase the efficiency and accuracy.

    Disadvantages of the project:

    As nothing is perfect in this world, we also not claim that our software is perfect as all

    other ,our project also has some limitations which are as follows::

    Differentiation is made between the upper case and the lower case limits that is

    if we type 'y' instead of 'Y' indicating yes, software will not respond.

    Date of transaction is not shown .

    It runs on a single system that is there is no networking.

    It is not suitable for a large no. of entries.

    ATM machine is very expensive.

  • 8/2/2019 Atm (Shiv Kumar)

    24/122

    SYSTEM DESIGN

    System designing is a process which has to be rendered by the system analyst he/she

    studies the manual system and the output comes, then he/she designs output graph chart

    for the programmer.

    Besides the analyst has to document the existing system to design the input

    and codes which a programmer use in his programs.

    INPUT DESIGN - Input design is essential part of this project. It is the explanation part

    of what we are inputting in the computer, which will help us in further processing before

    starting any other processing or before entering any other information.

    The five choices available in front of user for different menus. Open

    new account for open the account of a customer. Daily bank transactions for deposit or

    withdrawal money by cash or cheque. Reports menu to see the different reports of total

    accounts in the bank, particular account number & monthly reports.

    FILE DESIGN While reading and writing formatted text files is very easy. It is not

    always the most efficient way to handle files.

    If the file is open in the input mode then only read operation can

    perform from the file and if it is opened in the output mode then data can be only written.

    Append mode is used to add the data at the end of the file.

    Notice that write ( ), the functions we have used cin, cout, gets ( ) and puts( ) operates on

    input and output data. That is it treats the data stored in the object as a sequence of bytes

    and makes no assumptions about how these bytes should be handled. By contrast, the

    character-based functions take some liberties with the data. For example they expand the

  • 8/2/2019 Atm (Shiv Kumar)

    25/122

    \n or endl character into two bytes. A carriage return and a line feed-before storing it to

    disk. It makes the file more readably by dos-based utilities like type.

    The read ( ) and write ( ) functions work in different modes using this pointer so that

    entire objects can be saved to disk. No matter what sort of data they can single objects

    can be stored, as can arrays or other data structures of many objects. Various data files

    used in program which are as following.

    All the above data files contain the different and unique set of questions along with their

    options and the correct answer.

    All the files in the main program are used to take input. So that is open in main program

    in input mode. At time a single file will be open.

    Depending upon the random no. Which is granted on the bases of count system times

    second part. When one file will open all the input will come from that particular file.

    After taking the inputs, file will be closed.

    OUTPUT DESIGN Output from computer are required to communicate the results of

    processing to users. The major concern of the user in the system design is always with the

    output. Therefore, the output design must be intangible and impelling. If therefore the

    output design is poor, the entire system development is likely to be jeopardized. Once the

    output report format and content has been fixed the system analyst can work backward

    and draw the inputs and master file layout as also the computation to be performed to

    device the figure in the output report. Going for the back, the system analyst would

    evolve suitable procedure and design the forms to capture the input data of the banks.

  • 8/2/2019 Atm (Shiv Kumar)

    26/122

    SOURCE CODE

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

    // BANKING SYSTEM

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

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

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

    // 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

  • 8/2/2019 Atm (Shiv Kumar)

    27/122

    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 account information

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

    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:

    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

  • 8/2/2019 Atm (Shiv Kumar)

    28/122

    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

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

    float interest, amount, balance;

    };

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

    // menu function class

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

    class menu

    {

    public:

    void edit_menu(); //FOR EDIT MENU

    void main_menu(); //FOR MAIN MENU

    void list_menu(); //FOR REPORT MENU

    void help();

    };

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

    // Function for drawing box

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

    void drawbox(int x1, int y1, int x2, int y2)

  • 8/2/2019 Atm (Shiv Kumar)

    29/122

    {

    setcolor(GREEN);

    rectangle(x1,y1,x2,y2);

    }

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

    //Function to clear area of screen

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

    void clearbox( int x1,int y1, int x2, int y2)

    {

    int bk=getbkcolor();

    for(int col=x1;col

  • 8/2/2019 Atm (Shiv Kumar)

    30/122

    cleardevice();

    setbkcolor(56);

    setcolor(LIGHTBLUE);

    settextstyle(7,HORIZ_DIR,4);

    outtextxy(10,20," Transaction Processing System ");

    setcolor(GREEN);

    settextstyle(7,HORIZ_DIR,1);

    outtextxy(35,70, "This system keeps record of daily banking transaction");

    delay(200);

    outtextxy(35,100, "This program is capable of holding large no. of account.");

    delay(200);

    outtextxy(20,130, "(1). In first option you can open new account");

    delay(200);

    outtextxy(20,160, "(2). In second optiion you can do banking transactions");

    delay(200);

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

    delay(200);

    outtextxy(20,220, "(3). In third option you will get accounts report menu");

    delay(200);

    outtextxy(60,240, "-List of accounts");

    delay(200);

    outtextxy(60,260, "-Customer A/C information ");

    delay(200);

    outtextxy(60,280, "-Monthly account status");

    delay(200);

    outtextxy(20,310, "(4). In fourth option you will get accounts maintenance menu

    ");

    delay(200);

    outtextxy(60,330, "-Modify account");

    delay(200);

  • 8/2/2019 Atm (Shiv Kumar)

    31/122

    outtextxy(60,350, "-Close account ");

    delay(200);

    outtextxy(60,380, "Note-: Opening amount should not less that Rs. 500/-");

    delay(200);

    outtextxy(20,410, "(5). And last option is Quit (Exit to Window)");

    delay(200);

    setcolor(LIGHTBLUE);

    outtextxy(30,450,"Press any key to continue...");

    getch();

    cleardevice();

    main_menu();

    }

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

    // MAIN MENU OPTION SCREEN

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

    void menu:: main_menu()

    {

    cleardevice();

    // prototype for drawing box

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

    // prototype for clearing box

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

    account a; // object of class account

    initial i; // object of class initial

    menu m; // object of class menu

    setcolor(GREEN); //set text color to green

    rectangle(80,110,540,380);//for drawing rectangle

    rectangle(90,130,530,360);//for drawing rectangle

    setcolor(WHITE);//set text color to green

    //taking system date

  • 8/2/2019 Atm (Shiv Kumar)

    32/122

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

    struct date d;

    getdate(&d);

    int d1 = d.da_day;

    int m1 = d.da_mon;

    int y1 = d.da_year;

    gotoxy(9, 2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    33/122

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

    while(!kbhit())

    {

    int t1,t2,t3;

    struct time t;

    gettime(&t);

    t1=t.ti_hour;

    t2=t.ti_min;

    t3=t.ti_sec;

    setcolor(WHITE);

    outtextxy(10,32,"TIME :");

    gotoxy(9,3);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    34/122

    option=4;

    }

    break;

    case 13: done = 1;

    break;

    case 59: help();

    break;

    case 27: closegraph();

    exit(0);

    break;

    }

    switch(option)

    {

    case 0: clearbox(190,290,430,315);

    clearbox(190,200,430,225);

    clearbox(190,230,430,255);

    clearbox(190,260,430,285);

    drawbox(190,170,430,195);

    break;

    case 1: clearbox(190,170,430,195);

    clearbox(190,230,430,255);

    drawbox(190,200,430,225);

    break;

    case 2: clearbox(190,200,430,225);

    clearbox(190,260,430,285);

    drawbox(190,230,430,255);

    break;

    case 3: clearbox(190,230,430,255);

    clearbox(190,290,430,315);

  • 8/2/2019 Atm (Shiv Kumar)

    35/122

    drawbox(190,260,430,285);

    break;

    case 4: clearbox(190,260,430,285);

    clearbox(190,170,430,195);

    clearbox(190,200,430,225);

    clearbox(190,230,430,255);

    drawbox(190,290,430,315);

    break;

    }

    }while (!done);

    if (done==1 && option==0 )

    {

    a.new_account();

    }

    else

    if(done==1 && option==1)

    {

    a.transaction();

    }

    else

    if(done==1 && option==2)

    list_menu();

    else

    if(done==1 && option==3)

    edit_menu();

    else

    if(done==1 && option==4)

    { closegraph();

    exit(0);

    }

  • 8/2/2019 Atm (Shiv Kumar)

    36/122

    }

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

    // REPORT MENU OPTION SCREEN

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

    void menu::list_menu()

    {

    cleardevice();

    initial i;

    account a;

    menu m;

    setbkcolor(56);

    setcolor(GREEN);

    // for printing rectangle

    rectangle(80,110,540,380);

    rectangle(90,130,530,360);

    setcolor(WHITE);

    //to print system date

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

    struct date d;

    getdate(&d);

    int d1 = d.da_day;

    int m1 = d.da_mon;

    int y1 = d.da_year;

    gotoxy(9, 2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    37/122

    setcolor(WHITE);

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(10,15,"DATE :");

    outtextxy(225,114,"ACCOUNTS REPORT MENU");

    outtextxy(190,176," BANKS ACCOUNT LIST ");

    outtextxy(190,206," USER ACCOUNT INFORMATION");

    outtextxy(190,236," ACCOUNTS MONTHLY REPORT");

    outtextxy(190,266," RETURN TO MAIN MENU");

    outtextxy(210,364,"USE UP AND DOWN ARROW KEYS");

    outtextxy(480,15,"PRESS : HELP");

    outtextxy(480,33,"PRESS : EXIT");

    drawbox(190,170,420,195); //drawing box

    int option=0;

    int done=0;

    do

    {

    //taking sys time

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

    while(!kbhit())

    {

    int t1,t2,t3;

    struct time t;

    gettime(&t);

    t1=t.ti_hour;

    t2=t.ti_min;

    t3=t.ti_sec;

    setcolor(WHITE);

    outtextxy(10,32,"TIME :");

    gotoxy(9,3);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    38/122

    }

    int key = getch();

    switch (key)

    {

    case 81: option=3;

    break;

    case 73: option=0;

    break;

    case 80: option++;

    if (option==4)

    {

    option=0;

    }

    break;

    case 72: option--;

    if (option==-1)

    {

    option=3;

    }

    break;

    case 13: done = 1;

    break;

    case 59: help();

    break;

    case 27: closegraph();

    exit(0);

    break;

    }

    switch(option)

  • 8/2/2019 Atm (Shiv Kumar)

    39/122

    {

    case 0: clearbox(190,260,420,285);

    clearbox(190,200,420,225);

    clearbox(190,230,420,255);

    drawbox(190,170,420,195);

    break;

    case 1: clearbox(190,170,420,195);

    clearbox(190,230,420,255);

    drawbox(190,200,420,225);

    break;

    case 2: clearbox(190,200,420,225);

    clearbox(190,260,420,285);

    drawbox(190,230,420,255);

    break;

    case 3: clearbox(190,170,420,195);

    clearbox(190,200,420,225);

    clearbox(190,230,420,255);

    drawbox(190,260,420,285);

    break;

    }

    }while (!done);

    if (done==1 && option==0 )

    {

    i.display_list();

    }

    else

    if(done==1 && option==1)

    {

    a.display_account();

    }

  • 8/2/2019 Atm (Shiv Kumar)

    40/122

    else

    if(done==1 && option==2)

    {

    a.month_report();

    }

    else

    if(done==1 && option==3)

    main_menu();

    }

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

    // EDIT MENU OPTION SCREEN

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

    void menu::edit_menu()

    {

    cleardevice();

    initial i;

    account a;

    char ch;

    menu m;

    setbkcolor(56);

    setcolor(GREEN);

    rectangle(80,110,540,380);

    rectangle(90,130,530,360);

    setcolor(WHITE);

    //to print system date

    struct date d;

    getdate(&d);

    int d1 = d.da_day;

    int m1 = d.da_mon;

  • 8/2/2019 Atm (Shiv Kumar)

    41/122

    int y1 = d.da_year;

    gotoxy(9, 2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    42/122

    t2=t.ti_min;

    t3=t.ti_sec;

    setcolor(WHITE);

    outtextxy(10,32,"TIME :");

    gotoxy(9,3);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    43/122

    break;

    case 27: closegraph();

    exit(0);

    break;

    }

    switch(option)

    {

    case 0: clearbox(210,260,410,285);

    clearbox(210,230,410,255);

    drawbox(210,200,410,225);

    break;

    case 1: clearbox(210,200,410,225);

    clearbox(210,260,410,285);

    drawbox(210,230,410,255);

    break;

    case 2: clearbox(210,200,410,225);

    clearbox(210,230,410,255);

    drawbox(210,260,410,285);

    break;

    }

    }while (!done);

    if (done==1 && option==0 )

    {

    i.modify();

    }

    else

    if(done==1 && option==1)

    {

    a.close_account();

    }

  • 8/2/2019 Atm (Shiv Kumar)

    44/122

    else

    if(done==1 && option==2)

    main_menu();

    }

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

    // 1. FUNCTION FOR CREATING NEW ACCOUNT FOR NEW CUSTOMER

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

    void account::new_account(void)

    {

    cleardevice();

    char ch;

    int i, valid;

    int t_accno;

    account a;

    initial ini;

    menu m;

    setcolor(GREEN);

    rectangle(5,5,630,470);

    rectangle(5,70,630,470);

    rectangle(5,73,630,470);

    rectangle(7,7,627,467);

    setcolor(WHITE);

    outtextxy(20,16,"ENTER (0) TO EXIT");

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(230,40,"OPEN NEW ACCOUNT");

    settextstyle(2,HORIZ_DIR,5);

    // FOR DISPLAYING DATE

    int d1, m1, y1;

    struct date d;

    getdate(&d);

  • 8/2/2019 Atm (Shiv Kumar)

    45/122

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    t_accno = ini.last_accno();

    t_accno++;

    // APPENDS AND DELETES A DUMMY 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);

    add_to_file(t_accno, 1, 1, 1997, 'D', "INITIAL", 1.1, 1.1, 1.1);

    delete_account(t_accno);

    }

    char t_name[30], t[10], t_address[30];

    float t_bal = 0.0, t_balance = 0.0;

    outtextxy(450,16,"DATE :");

    gotoxy(65,2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    46/122

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

    m.main_menu();

    if (strlen(t_name) == 0 || strlen(t_name) > 30)

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER NAME OF THE ACCOUNT HOLDER");

    setcolor(WHITE);

    outtextxy(50,420,"NAME SHOULD NOT LESS THEN 0 AND GREATER

    THEN 30 CHARACTERS");

    getch();

    setcolor(x);

    outtextxy(50,420,"NAME SHOULD NOT LESS THEN 0 AND GREATER

    THEN 30 CHARACTERS");

    setcolor(WHITE);

    }

    }while (!valid);

    do

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER NAME OF THE ACCOUNT HOLDER");

    outtextxy(50,420,"ADDRESS SHOULD NOT LESS THEN 0 AND GREATER

    THEN 30 CHARACTERS");

    setcolor(WHITE);

    outtextxy(40,190,"ADDRESS :");

    outtextxy(50,420,"ENTER ADDRESS OF THE ACCOUNT HOLDER");

  • 8/2/2019 Atm (Shiv Kumar)

    47/122

    valid = 1;

    gotoxy(17,13);

    gets(t_address);

    strupr(t_address);

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

    m.main_menu();

    if (strlen(t_address) == 0 || strlen(t_address) > 30)

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER ADDRESS OF THE ACCOUNT HOLDER");

    setcolor(WHITE);

    outtextxy(50,420,"ADDRESS SHOULD NOT LESS THEN 0 AND

    GREATER THEN 30 CHARACTERS");

    getch();

    }

    }while (!valid);

    do

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER ADDRESS OF THE ACCOUNT HOLDER");

    outtextxy(50,420,"INITIAL AMOUNT SHOULD NOT LESS THEN 500");

    setcolor(WHITE);

    outtextxy(40,238,"INITIAL DEPOSIT : ");

    outtextxy(50,420,"ENTER INITIAL AMOUNT TO BE DEPOSITED");

    clear(25,16);

  • 8/2/2019 Atm (Shiv Kumar)

    48/122

    valid = 1;

    gotoxy(25,16);

    gets(t);

    t_bal = atof(t);

    t_balance = t_bal;

    if (t_balance < 500)

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER INITIAL AMOUNT TO BE DEPOSITED");

    setcolor(WHITE);

    outtextxy(50,420,"INITIAL AMOUNT SHOULD NOT LESS THEN 500");

    getch();

    }

    }while (!valid);

    do

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,420,"ENTER INITIAL AMOUNT TO BE DEPOSITED");

    valid = 1;

    setcolor(WHITE);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"DO YOU WANT TO SAVE RECORD (Y/N):");

    settextstyle(2,HORIZ_DIR,5);

    ch = getche();

  • 8/2/2019 Atm (Shiv Kumar)

    49/122

    ch = toupper(ch);

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

    if (ch == 'N')

    m.main_menu();

    // variable decl.

    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);

    do

    {

    cleardevice();

    settextstyle(2,HORIZ_DIR,8);

    setcolor(GREEN);

    outtextxy(50,225,"DO YOU WANT TO CREATE ANOTHER: (Y/N)");

    setcolor(GREEN);

    settextstyle(2,HORIZ_DIR,5);

    ch=getch();

    ch=toupper(ch);

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

    if(ch=='Y')

    new_account();

    if(ch=='N')

    m.main_menu();

    }

  • 8/2/2019 Atm (Shiv Kumar)

    50/122

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

    // 2. FUNCTION FOR DISPLAYING ACCOUNT FROM INITIAL.DAT

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

    void initial::display_list(void)

    {

    cleardevice();

    int flag;

    int k;

    menu m;

    float t_bal = 0.0;

    fstream file;

    setcolor(GREEN);

    rectangle(5,5,630,470);

    rectangle(7,7,627,467);

    rectangle(20,65,600,90);

    setcolor(WHITE);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(190,20,"LIST OF ACCOUNTS IN BANK");

    settextstyle(2,HORIZ_DIR,5);

    setcolor(LIGHTBLUE);

    outtextxy(30,70,"ACCNO.");

    outtextxy(100,70,"NAME");

    outtextxy(260,70,"ADDRESS");

    outtextxy(515,70,"BALANCE");

    setcolor(WHITE);

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

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

    int row = 8;

    // Reads all the records to display on the screen

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

  • 8/2/2019 Atm (Shiv Kumar)

    51/122

    {

    flag = 0;

    gotoxy(7, row);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    52/122

    row++;

    gotoxy(7, row);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    53/122

    rectangle(7,7,627,467);

    rectangle(15,80,600,110);

    setcolor(WHITE);

    int d1, m1, y1;

    struct date d;

    getdate(&d);

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    outtextxy(450,14,"DATE :");

    gotoxy(65, 2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    54/122

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

    void account::display_account(void)

    {

    cleardevice();

    char t_acc[10],ch;

    int j,valid;

    float tamt = 0, damt = 0, wamt = 0;

    account a;

    menu m;

    int t, t_accno;

    do

    {

    valid=1;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(30,60,"ACCOUNT NOT FOUND");

    setcolor(WHITE);

    outtextxy(30,60,"ENTER ACCOUNT NO.");

    gotoxy(32,5);

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

    if (t_accno == 0)

    m.list_menu();

    cleardevice();

    initial ini;

    if (!ini.found_account(t_accno))

    {

  • 8/2/2019 Atm (Shiv Kumar)

    55/122

    valid=0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(30,60,"ENTER ACCOUNT NO.");

    setcolor(WHITE);

    outtextxy(30,60,"ACCOUNT NOT FOUND");

    clear(32,5);

    getch();

    }

    }while(!valid);

    settextstyle(2,HORIZ_DIR,5);

    // 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(5, row);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    56/122

    damt = damt + amount;

    tamt = tamt + amount;

    gotoxy(32, row);

    }

    else

    {

    wamt = wamt + amount;

    tamt = tamt - amount;

    gotoxy(44, row);

    }

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    57/122

    int i;

    row = 4;

    outtextxy(50,440,"Press any key to continue");

    getch();

    cleardevice();

    rectangle(5,5,630,470);

    rectangle(7,7,627,467);

    }

    }

    }

    file.close();

    gotoxy(4, row);

    for (j = 4; j

  • 8/2/2019 Atm (Shiv Kumar)

    58/122

  • 8/2/2019 Atm (Shiv Kumar)

    59/122

    if(ch=='N')

    m.list_menu();

    }

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

    // 5. FUNCTION FOR DISPLAYING MONTHLY TRANSACTION REPORT

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

    void account::month_report(void)

    {

    int dd1, mm1, yy1;

    menu m;

    cleardevice();

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(50,60,"ENTER DATE OF THE MONTH ");

    settextstyle(2,HORIZ_DIR,5);

    gotoxy(38, 5);

    cin >> dd1;

    gotoxy(40, 5);

    cout > mm1;

    gotoxy(43, 5);

    cout > yy1;

    char t_acc[10];

    int j,valid;

    float tamt = 0, damt = 0, wamt = 0;

    int t, t_accno;

    initial ini;

  • 8/2/2019 Atm (Shiv Kumar)

    60/122

    cleardevice();

    do

    {

    valid=1;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(30,58,"ACCOUNT NOT FOUND");

    setcolor(WHITE);

    outtextxy(30,58,"ENTER ACCOUNT NO.");

    gotoxy(32,5);

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

    if (t_accno == 0)

    m.list_menu();

    if (!ini.found_account(t_accno))

    {

    valid=0;

    x=getbkcolor();

    setcolor(x);

    outtextxy(30,58,"ENTER ACCOUNT NO.");

    setcolor(WHITE);

    outtextxy(30,58,"ACCOUNT NOT FOUND");

    clear(32,5);

    getch();

    }

    }while(!valid);

    cleardevice();

  • 8/2/2019 Atm (Shiv Kumar)

    61/122

    settextstyle(2,HORIZ_DIR,5);

    box_for_display(t_accno);

    if(mm1==1)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: JANUARY ");

    }

    if(mm1==2)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: FEBRUARY");

    }

    if(mm1==3)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: MARCH");

    }

    if(mm1==4)

  • 8/2/2019 Atm (Shiv Kumar)

    62/122

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: APRIL");

    }

    if(mm1==5)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: MAY ");

    }

    if(mm1==6)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: JUNE ");

    }

    if(mm1==7)

    {

    int x;

    x=getbkcolor();

  • 8/2/2019 Atm (Shiv Kumar)

    63/122

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: JULY ");

    }

    if(mm1==8)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: AUGUST ");

    }

    if(mm1==9)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: SEPTEMBER");

    }

    if(mm1==10)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

  • 8/2/2019 Atm (Shiv Kumar)

    64/122

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: OCTOBER ");

    }

    if(mm1==11)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: NOVEMBER ");

    }

    if(mm1==12)

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(20,50,"ACCOUNT RECORD");

    setcolor(WHITE);

    outtextxy(20,50,"MONTH: DECEMBER ");

    }

    getch();

    int row = 9, flag;

    fstream file;

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

    float pre_balance = 0.0; // Previous balance amount

    // The loop finds the last months balance

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

  • 8/2/2019 Atm (Shiv Kumar)

    65/122

    {

    // Checks the account no. and till the previous month and till current year

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

  • 8/2/2019 Atm (Shiv Kumar)

    66/122

    gotoxy(16, row);

    puts(type);

    if (tran == 'D')

    {

    damt = damt + amount;

    tamt = tamt + amount;

    gotoxy(32, row);

    }

    else

    {

    wamt = wamt + amount;

    tamt = tamt - amount;

    gotoxy(44, row);

    }

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    67/122

    // If row increases 23 then the next screen continues

    if (row > 23)

    {

    flag = 1;

    row = 5;

    outtextxy(50,440,"Press any key to continue");

    getch();

    cleardevice();

    }

    }

    }

    file.close();

    gotoxy(4, row);

    for (j = 4; j

  • 8/2/2019 Atm (Shiv Kumar)

    68/122

    gotoxy(44, row);

    // Withdraw amount

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    69/122

    {

    cleardevice();

    setcolor(GREEN);

    settextstyle(2,HORIZ_DIR,8);

    outtextxy(50,240,"DO YOU WANT TO CONTINUE : (Y/N)");

    setcolor(WHITE);

    ch=getch();

    ch=toupper(ch);

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

    if(ch=='Y')

    month_report();

    if(ch=='N')

    m.list_menu();

    }

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

    // 6. FUNCTION FOR MAKING DAILY TRANSACTION (DEPOSIT / WITHDRAW)

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

    void account::transaction(void)

    {

    cleardevice();

    char t_acc[10];

    menu m;

    initial ini;

    int j;

    int t, t_accno, valid;

    do

    {

    valid=1;

    int x;

    x=getbkcolor();

  • 8/2/2019 Atm (Shiv Kumar)

    70/122

    setcolor(x);

    outtextxy(40,180,"ACCOUNT NOT FOUND");

    setcolor(WHITE);

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(50,16,"ENTER (0) TO EXIT");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(40,73,"ENTER ACCOUNT NO. :");

    gotoxy(35,6);

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

    if (t_accno == 0)

    m.main_menu();

    if (!ini.found_account(t_accno))

    {

    valid=0;

    int x;

    x=getbkcolor();

    setcolor(x);

    setcolor(WHITE);

    settextstyle(2,0,5);

    outtextxy(40,73,"ENTER ACCOUNT NO. :");

    clear(35,6);

    setcolor(WHITE);

    outtextxy(40,180,"ACCOUNT NOT FOUND");

    clear(35,6);

    getch();

    }

    }while(!valid);

    cleardevice();

  • 8/2/2019 Atm (Shiv Kumar)

    71/122

  • 8/2/2019 Atm (Shiv Kumar)

    72/122

    gotoxy(20,9);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    73/122

    t_tran = toupper(t_tran);

    }while (t_tran != 'D' && t_tran != 'W');

    if(t_tran=='D')

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(180,222,"DEPOSIT / WITHDRAW (D/W) : ");

    setcolor(WHITE);

    outtextxy(195,222,"DEPOSIT INTO ACCOUNT");

    }

    if(t_tran=='W')

    {

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(180,222,"DEPOSIT / WITHDRAW (D/W) : ");

    setcolor(WHITE);

    outtextxy(195,222,"WITHDRAWAL FROM ACCOUNT");

    }

    settextstyle(2,HORIZ_DIR,5);

    do

    {

    valid = 1;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"ENTER CORRECTLY");

    setcolor(WHITE);

  • 8/2/2019 Atm (Shiv Kumar)

    74/122

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"TRANSACTION BY CASH OR CHEQUE ");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(40,288,"CASH/CHEQUE : ");

    gotoxy(20, 19);

    gets(t_type);

    strupr(t_type);

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

    m.main_menu();

    if (strcmp(t_type, "CASH") && strcmp(t_type, "CHEQUE"))

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"TRANSACTION BY CASH OR CHEQUE ");

    setcolor(WHITE);

    outtextxy(50,420,"ENTER CORRECTLY");

    clear(20,19);

    getch();

    }

    }while (!valid);

    do

    {

    valid = 1;

    int x;

    x=getbkcolor();

    setcolor(x);

  • 8/2/2019 Atm (Shiv Kumar)

    75/122

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"TRANSACTION BY CASH OR CHEQUE ");

    outtextxy(50,420,"AMOUNT MUST BE SMALLER THEN A/C

    BALANCE ");

    setcolor(WHITE);

    outtextxy(50,420,"ENTER THE AMOUNT ");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(40,334,"AMOUNT Rs. :");

    gotoxy(20,22);

    gets(tm);

    t_amt = atof(tm);

    t_amount = t_amt;

    if (t_amount ==0 )

    m.main_menu();

    if ((t_tran == 'W' && t_amount > t_balance) || (t_amount < 0))

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"ENTER THE AMOUNT ");

    setcolor(WHITE);

    outtextxy(50,420,"AMOUNT MUST BE SMALLER THEN A/C

    BALANCE ");

    clear(20,22);

    getch();

    }

    }while (!valid);

  • 8/2/2019 Atm (Shiv Kumar)

    76/122

    char ch;

    do

    {

    valid = 1;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,420,"ENTER THE AMOUNT ");

    setcolor(WHITE);

    settextstyle(2,HORIZ_DIR,8);

    outtextxy(50,420,"SAVE TRANSACTION (Y/N) : ");

    settextstyle(2,HORIZ_DIR,5);

    ch = getche();

    if (ch == '0')

    m.main_menu();

    ch = toupper(ch);

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

    if (ch == 'N')

    m.main_menu();

    float t_interest;

    t_interest = calculate_interest(t_accno, t_balance);

    if (t_tran == 'D')

    t_balance = t_balance + t_amount + t_interest;

    else

    t_balance = (t_balance - t_amount) + t_interest;

    // Modified records are updated in data bases.

  • 8/2/2019 Atm (Shiv Kumar)

    77/122

    ini.update_balance(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);

    do

    {

    cleardevice();

    settextstyle(2,HORIZ_DIR,7);

    setcolor(GREEN);

    outtextxy(50,240,"DO YOU WANT TO MAKE ANOTHER TRANSACTION :

    (Y/N)");

    setcolor(WHITE);

    ch=getch();

    ch=toupper(ch);

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

    if(ch=='Y')

    transaction();

    if(ch=='N')

    m.main_menu();

    }

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

    // 7. FUNCTION FOR CLOSING ANY ACCOUNT AFTER INPUTING ACCOUNT

    NUMBER

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

    void account::close_account(void)

    {

    cleardevice();

    menu m;

    initial ini;

    char t_acc[10],ch;

    int t, t_accno,valid;

    setcolor(WHITE);

  • 8/2/2019 Atm (Shiv Kumar)

    78/122

    do

    {

    valid=1;

    outtextxy(30,13,"ENTER (0) TO EXIT");

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(30,50,"ACCOUNT NOT FOUND");

    setcolor(WHITE);

    outtextxy(30,50,"ENTER ACCOUNT NO. ");

    gotoxy(32,4);

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

    if (t_accno == 0)

    m.edit_menu();

    if (!ini.found_account(t_accno))

    {

    valid=0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(30,50,"ENTER ACCOUNT NO. ");

    setcolor(WHITE);

    outtextxy(30,50,"ACCOUNT NOT FOUND");

    clear(32,4);

    getch();

    }

  • 8/2/2019 Atm (Shiv Kumar)

    79/122

    settextstyle(2,HORIZ_DIR,5);

    }while(!valid);

    cleardevice();

    setcolor(2);

    rectangle(5,5,630,470);

    rectangle(5,70,630,470);

    rectangle(5,73,630,470);

    rectangle(7,7,627,467);

    rectangle(5,247,627,467);

    rectangle(7,250,627,467);

    setcolor(WHITE);

    outtextxy(15,13, "ENTER (0) TO EXIT");

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(200,40,"CLOSE ACCOUNT CONSOLE");

    settextstyle(2,HORIZ_DIR,5);

    int d1, m1, y1;

    struct date d;

    getdate(&d);

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    outtextxy(470,14,"DATE :");

    gotoxy(67,2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    80/122

    ch = getche();

    if (ch == '0')

    m.edit_menu();

    ch = toupper(ch);

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

    if (ch == 'N')

    m.edit_menu();

    // Function calls to delete the existing account no.

    ini.delete_account(t_accno);

    delete_account(t_accno);

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(220,350,"ACCOUNT CLOSED");

    settextstyle(2,HORIZ_DIR,5);

    outtextxy(50,440,"Press any key to continue...");

    getch();

    do

    {

    cleardevice();

    setcolor(2);

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(50,220,"DO YOU WANT TO CLOSE ANOTHER: (Y/N)");

    settextstyle(2,HORIZ_DIR,5);

    setcolor(WHITE);

    ch=getch();

    ch=toupper(ch);

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

    if(ch=='Y')

    close_account();

    if(ch=='N')

  • 8/2/2019 Atm (Shiv Kumar)

    81/122

    m.edit_menu();

    }

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

    // 8. FUNCTION FOR MODIFYING THE EXISTING ACCOUNTS

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

    void initial::modify(void)

    {

    cleardevice();

    int valid;

    account a;

    initial i;

    menu m;

    char t_acc[10];

    int t, t_accno;

    setcolor(WHITE);

    outtextxy(30,13,"ENTER (0) TO EXIT");

    do

    {

    valid=1;

    int x;

    x=getbkcolor();

    setcolor(x);

    settextstyle(2,HORIZ_DIR,6);

    outtextxy(30,50,"ACCOUNT NOT FOUND");

    setcolor(WHITE);

    outtextxy(30,50,"ENTER ACCOUNT NO.");

    gotoxy(32,4);

    gets(t_acc);

    t = atoi(t_acc);

    t_accno = t;

  • 8/2/2019 Atm (Shiv Kumar)

    82/122

    if (t_accno == 0)

    m.edit_menu();

    if (!found_account(t_accno))

    {

    valid=0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(30,50,"ENTER ACCOUNT NO.");

    setcolor(WHITE);

    outtextxy(30,50,"ACCOUNT NOT FOUND");

    a.clear(32,4);

    getch();

    }

    settextstyle(2,HORIZ_DIR,5);

    }while(!valid);

    cleardevice();

    setcolor(2);

    rectangle(5,5,630,470);

    rectangle(5,70,630,470);

    rectangle(5,73,630,470);

    rectangle(7,7,627,467);

    rectangle(5,247,627,467);

    rectangle(7,250,627,467);

    setcolor(WHITE);

    outtextxy(15,13, "ENTER (0) TO EXIT");

    settextstyle(2,HORIZ_DIR,7);

    outtextxy(200,40,"MODIFY ACCOUNT CONSOLE");

    settextstyle(2,HORIZ_DIR,5);

    int d1, m1, y1;

  • 8/2/2019 Atm (Shiv Kumar)

    83/122

    struct date d;

    getdate(&d);

    d1 = d.da_day;

    m1 = d.da_mon;

    y1 = d.da_year;

    outtextxy(470,14,"DATE :");

    gotoxy(67,2);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    84/122

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"NAME MUST NOT GREATER THEN 25

    CHARACTERS");

    setcolor(WHITE);

    outtextxy(50,430,"ENTER NAME OR PRESS ENTER FOR NO

    CHANGE");

    valid = 1;

    gotoxy(22,20);

    gets(t_name);

    strupr(t_name);

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

    m.edit_menu();

    if (strlen(t_name) > 25)

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"ENTER NAME OR PRESS ENTER FOR NO

    CHANGE");

    setcolor(WHITE);

    outtextxy(50,430,"NAME MUST NOT GREATER THEN 25

    CHARACTERS");

    getch();

    }

    } while (!valid);

    do

    {

    settextstyle(2,HORIZ_DIR,6);

  • 8/2/2019 Atm (Shiv Kumar)

    85/122

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"ENTER NAME OR PRESS ENTER FOR NO

    CHANGE");

    outtextxy(50,430,"ADDRESS MUST NOT GREATER THEN 25

    CHARACTERS");

    setcolor(WHITE);

    outtextxy(50,430,"ENTER ADDRESS OR PRESS ENTER FOR NO

    CHANGE");

    valid = 1;

    gotoxy(22,22);

    gets(t_address);

    strupr(t_address);

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

    m.edit_menu();

    if (strlen(t_address) > 25)

    {

    valid = 0;

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"ENTER ADDRESS OR PRESS ENTER FOR

    NO CHANGE");

    setcolor(WHITE);

    outtextxy(50,430,"ADDRESS MUST NOT GREATER THEN 25

    CHARACTERS");

    getch();

    }

    } while (!valid);

  • 8/2/2019 Atm (Shiv Kumar)

    86/122

    if (strlen(t_address) > 0)

    modified = 1;

    if (!modified)

    m.edit_menu();

    do

    {

    settextstyle(2,HORIZ_DIR,6);

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"ENTER ADDRESS OR PRESS ENTER FOR NO

    CHANGE");

    setcolor(WHITE);

    outtextxy(50,430,"DO YOU WANT TO SAVE CHANGE (Y/N): ");

    ch = getche();

    if (ch == '0')

    m.edit_menu();

    ch = toupper(ch);

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

    if (ch == 'N')

    m.edit_menu();

    // Passes the parameter to add in data file

    modify_account(t_accno, t_name, t_address);

    int x;

    x=getbkcolor();

    setcolor(x);

    outtextxy(50,430,"DO YOU WANT TO SAVE CHANGE (Y/N): ");

    setcolor(WHITE);

    outtextxy(220,390,"RECORD IS MODIFIED");

    outtextxy(50,430,"Press any key to continue...");

  • 8/2/2019 Atm (Shiv Kumar)

    87/122

    settextstyle(2,HORIZ_DIR,5);

    getch();

    cleardevice();

    m.edit_menu();

    }

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

    // 9. FUNCTION FOR DISPLAYING AN ACCOUNT WHEN MODIFIED

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

    void initial::display(int t_accno)

    {

    fstream file;

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

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

    // Displays the record contents matching with t_accno from INITIAL.dat data file

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

    {

    if (t_accno == accno)

    {

    outtextxy(30,110,"ACCOUNT NO. :");

    gotoxy(20,8);

    cout

  • 8/2/2019 Atm (Shiv Kumar)

    88/122

  • 8/2/2019 Atm (Shiv Kumar)

    89/122

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

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

    file.close();

    return;

    }

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

    // 11. 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;

    }

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

    ******

    // 12. THIS FUNCTION IS USED TO CREATE NEW FRESH RECORDS 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);

  • 8/2/2019 Atm (Shiv Kumar)

    90/122

  • 8/2/2019 Atm (Shiv Kumar)

    91/122

    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();

    }

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

    ************

    // 14. FUNCTION TO ADD ACCOUNT DETAILS OF DAILY TRANACTION INTO

    BANKING.DAT FILE

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

    ************

    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;

    dd = d1;

    mm = m1;

  • 8/2/2019 Atm (Shiv Kumar)

    92/122

    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();

    }

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

    // 15. FUNCTION FOR DELETING AN ACCOUNT FROM BANKING.DAT FILE

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

    void account::delete_account(int t_accno)

    {

    menu m;

    fstream file;

    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));

  • 8/2/2019 Atm (Shiv Kumar)

    93/122

    }

    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())

    {

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

    if (temp.eof())

    break;

    if (accno != t_accno)

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

    }

    file.close();

    temp.close();

    }

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

    // 16. FUNCTION FOR CLEARING SPECIFIED ROW AND COLUMN

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

    void account::clear(int col, int row)

    {

    for (int j = col; j

  • 8/2/2019 Atm (Shiv Kumar)

    94/122

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

    // 17. FUNCTION TO FOUND AN ACCOUNT FOR DISPLAY ACCOUNT

    FUNCTION

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

    int initial::found_account(int t_accno)

    {

    fstream file;

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

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

    int found = 0;

    // Searches the specified record in INITIAL.dat data file

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

    {

    if (accno == t_accno)

    {

    found = 1;

    break;

    }

    }

    file.close();

    return found;

    }

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

    // 18. 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);

  • 8/2/2019 Atm (Shiv Kumar)

    95/122

    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);

    break;

    }

    }

    file.close();

    return t_name;

    }

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

    ****

    // 19. FUNCTION FOR RETURN ADDRESS OF THE ACCOUNT HOLDER FROM

    INITIAL.DAT

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

    ****

    char *initial::return_address(int t_accno)

    {

    fstream file;

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

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

    char t_address[30];

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

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

    {

    if (accno == t_accno)

  • 8/2/2019 Atm (Shiv Kumar)

    96/122

    {

    strcpy(t_address, address);

    break;

    }

    }

    file.close();

    return t_address;

    }

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

    // 20. 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;

    // 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;

    }

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

  • 8/2/2019 Atm (Shiv Kumar)

    97/122

    // 21. 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)))

    {

    count++;

    if (t_accno == accno)

    break;

    }

    file.close();

    return count;

    }

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

    // 22. 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);

  • 8/2/2019 Atm (Shiv Kumar)

    98/122

    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

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

    file.close();

    }

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

    // 23. FUNCTION TO RETURN NO. OF 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++;

  • 8/2/2019 Atm (Shiv Kumar)

    99/122

    }

    }

    return days;

    }

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

    // 24. FUNCTION FOR CALCULATING 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;

    float t_interest = 0.0;

  • 8/2/2019 Atm (Shiv Kumar)

    100/122

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

    {

    months = days / 30;

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

    }

    file.close();

    return t_interest;

    }

    void main()

    {

    clrscr();

    menu m;

    int gdriver = DETECT, gmode, errorcode;

    initgraph(&gdriver, &gmode, "\\tc\\bgi");

    setcolor(7);

    rectangle(19, 7, 630, 450); // Draw a rectangle

    rectangle(29, 17, 620, 440);

    setbkcolor(56); // Sets the background colour

    highvideo();

    setcolor(GREEN);

    settextstyle(1, HORIZ_DIR, 11);

    outtextxy(65, 30, "BANKING");

    outtextxy(90, 170, "SYSTEM");

    settextstyle(1, HORIZ_DIR, 4);

    setcolor(LIGHTBLUE);

  • 8/2/2019 Atm (Shiv Kumar)

    101/122

    outtextxy(219,350,"DEVELOPED BY ");

    setcolor(LIGHTBLUE);

    outtextxy(220, 390,"ANKIT SAXENA");

    getch();

    m.main_menu();

    }

  • 8/2/2019 Atm (Shiv Kumar)

    102/122

    OUTPUT

    -----------------------------------------------------

    WELCOME TO

    ICICI BANK

    -----------------------------------------------------

    Enter your pin number: 12345

    Enter your pin number: 12345

    1. Display Balance

    2. Deposite

    3. Withdrawal

  • 8/2/2019 Atm (Shiv Kumar)

    103/122

    4. Transfer Funds

    5. Exit

    ----------------------------------

    Select a Transaction: 1

    Checking Account Balance: Rs. 230.00

    Savings Account Balance:Rs. 543.34

    Would you like Another Transaction?Y/N: Y

    Would you like Another Transaction?Y/N: Y

  • 8/2/2019 Atm (Shiv Kumar)

    104/122

    1. Display Balance

    2. Deposite

    3. Withdrawal

    4. Transfer Funds

    5. Exit

    ----------------------------------

    Select a Transaction: 2

    1 - Saving

    2 - Checking

    ----------------------

    Select Account:1

  • 8/2/2019 Atm (Shiv Kumar)

    105/122

    Please enter Transaction Amount

    Amount: Rs. 200

    Deposited to Savings : Rs. 200.00

  • 8/2/2019 Atm (Shiv Kumar)

    106/122

  • 8/2/2019 Atm (Shiv Kumar)

    107/122

    Checking Account Balance: Rs. 230.00

    Savings Account Balance:Rs. 743.34

    Would you like Another Transaction?Y/N: Y

    Would you like Another Transaction?Y/N: Y

    1. Display Balance

    2. Deposite

    3. Withdrawal

    4. Transfer Funds

    5. Exit

    ----------------------------------

    Select a Transaction: 3

  • 8/2/2019 Atm (Shiv Kumar)

    108/122

    1 - Saving

    2 - Checking

    ----------------------

    Select Account:1

    Please enter Transaction Amount

  • 8/2/2019 Atm (Shiv Kumar)

    109/122

    Amount: Rs. 100

    Withdrawal Successful : Rs. 100.00

    Would you like Another Transaction?Y/N: Y

    Would you like Another Transaction?Y/N: Y

  • 8/2/2019 Atm (Shiv Kumar)

    110/122

    1. Display Balance

    2. Deposite

    3. Withdrawal

    4. Transfer Funds

    5. Exit

    ----------------------------------

    Select a Transaction: 4

    1 - Savings to Checking

    2 - Checking to Savings

    Enter a Selection: 1

  • 8/2/2019 Atm (Shiv Kumar)

    111/122

    Please enter Transaction Amount

    Amount: Rs. 100

    Transfer Successful

    Rs. 100.00 transferred to Checking

  • 8/2/2019 Atm (Shiv Kumar)

    112/122

    Would you like Another Transaction?Y/N: Y

    Would you like Another Transaction?Y/N: Y

    1. Display Balance

    2. Deposite

    3. Withdrawal

    4. Transfer Funds

    5. Exit

    ----------------------------------

    Select a Transaction: 6

    Invalid Selection

    Select 1 to 5: 5

  • 8/2/2019 Atm (Shiv Kumar)

    113/122

    CONCLUSION

    This project on ATM is undertaken to enhance the working capabilities of the

    Banking environment & for the quick storage and withdrawal of funds. The system after

    implementation prove to be on same track. The quality of any project is measured to

    merits and demerits of the project.

  • 8/2/2019 Atm (Shiv Kumar)

    114/122

    PROPOSED SYSTEMS

    The objective is to computerize the manual system or the current system to improve the

    functionality. Main objective is to provide quick retrieval and storage of cash or money

    with in a few seconds.ATM intended to fulfill the needs of customers who demand

    reference for their innovative work. The software supplies information about the

    transaction of money and funds . In this software money or funds can be withdrawal and

    deposited quickly with in fraction of seconds. It also displays the saving and checking

    account balances.

    Advantages of the Proposed System:

    It provides flow in the transaction of funds

    Being automatic it prevents manual mistakes for being committed.

    System will provide greater reliability and efficiency in working.

    Transaction are made up to date.

    Consistency in the abbreviation and in the use of singular and plural forms for the table

    and column Names.

    The meaning of each table has been documented.

    Each table has been normalizes.

    Proper data type for each table has been selected.

    Column that allow null values defined last. For conserving storage space.

    The benefits of the set of well designed tables are following:

    Reduce storage of redundant data, which eliminated the cost of updating duplicates

    and avoids the risk of inconstant result based on duplicates.

    Increased ability to effectively enforce integrity constraints.

  • 8/2/2019 Atm (Shiv Kumar)

    115/122

    Increased ability to adopt to the growth and change of the system.

    Increased ability to adopt to the growth and change of the system.

    Increased productivity based on the inherent flexibility of will design relational

    system.After completing the database design designing of the application has been done which

    is an iterative process and case to rethink the database design. For the above the

    following determination has also been made.

    What existing applications are available and how they are being used.

    What data is available, if any can be eliminated or if any additional data must be

    collected.

  • 8/2/2019 Atm (Shiv Kumar)

    116/122

  • 8/2/2019 Atm (Shiv Kumar)

    117/122

  • 8/2/2019 Atm (Shiv Kumar)

    118/122

  • 8/2/2019 Atm (Shiv Kumar)

    119/122

  • 8/2/2019 Atm (Shiv Kumar)

    120/122

  • 8/2/2019 Atm (Shiv Kumar)

    121/122

  • 8/2/2019 Atm (Shiv Kumar)

    122/122