Thread: ATM Help

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    4

    Post ATM Help

    How can you use files to check for a pin number and name ? which is oviously recorded in the file.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    This question makes no sense

  3. #3
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    I'm going to make a >guess< as to what your question is and specify it, then try to offer hints to help.

    I'm assuming you want to know how to search a list of accounts and their pin numbers to cross-reference user input. Via loggin in, or some other mechanism. The subject of this matter is "Databases". Database refers to the use of some medium to store (and typically retrieve) information in an orderly fashion. Guaging by your question, Im going to assume you are new to the idea and recomend using a technique called "flat-file databasing" (rather then ODBC, MySQL etc). Flat-file simply referes to using text like files to store your information in a uniform manner. An example of a database file for bank accounts might resemble:

    Code:
    John Doe
    555555
    1234
    Utah
    USA
    500
    
    Jane Smith
    525555
    6789
    bumfck
    egypt
    8029
    The file is grouped in something called a "Record". A record is a collection of info relating to a single object (in more advanced databases a Record would consist of all the Columns in one Row).

    The format of the record in this file is :
    first line - name
    second line - account number
    third line - pin number
    fourth line - state
    fifth line - country
    six line - money ammount

    One way to go about getting user information is to write a function that opens the file, and reads the contents into an array of Records (you might make a class or struct for a record).

    Later in your program when you want to compare names with passwords (or pins) you use a for loop to sift through the array of records comparing the desired information.

    I hope this helps.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ATM assignment
    By Ahmed29 in forum C++ Programming
    Replies: 2
    Last Post: 11-08-2008, 05:44 AM
  2. c++ program for ATM machine
    By cplus2x in forum C++ Programming
    Replies: 2
    Last Post: 02-06-2008, 04:35 AM
  3. ATM trouble???
    By 1rwhites in forum C Programming
    Replies: 4
    Last Post: 10-31-2005, 06:52 PM
  4. Part of ATM problem
    By 1rwhites in forum C Programming
    Replies: 9
    Last Post: 10-28-2005, 11:29 AM
  5. ATM prog
    By giovs in forum C Programming
    Replies: 4
    Last Post: 10-06-2004, 06:38 AM