I need help with an ATM program!!!

Help!!!!
«1

Comments

  • : Help!!!!
    :
    Would you be so kind as to tell us detailed information about what do you need, thanks

    ****************
    Any questions? Just ask!

    :-) [b][blue]GAASHIUS[/blue][/b] :-)


  • I need a template if poss
  • Sorry, I would really like to help you, but my english is terrible(as you can see), and that ATM is a thing that I do not understand.

    ****************
    Any questions? Just ask!

    :-) [b][blue]GAASHIUS[/blue][/b] :-)


  • : Help!!!!
    :

    You need to be more specific. Obviously this is a school project, so you won't get much help if all you're willing to put in is "Help!!!!"

    Tell what you need the program to do, what you have or where you are having problems. I'll give a general answer for a general question.

    1) Create a loop
    2) Ask for a choice
    3) Process choice (call procedure) or "Finish Transaction"
    4) Goto #1 until "Finish Transaction" is called

    Good Luck,

    Phat Nat

  • : : Help!!!!
    : :
    :
    : You need to be more specific. Obviously this is a school project, so you won't get much help if all you're willing to put in is "Help!!!!"
    :
    : Tell what you need the program to do, what you have or where you are having problems. I'll give a general answer for a general question.
    :
    : 1) Create a loop
    : 2) Ask for a choice
    : 3) Process choice (call procedure) or "Finish Transaction"
    : 4) Goto #1 until "Finish Transaction" is called
    :
    : Good Luck,
    :
    : Phat Nat
    :
    :

  • Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.

    Stoo
  • : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    :
    : Stoo
    :
    Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
  • : : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    : :
    : : Stoo
    : :
    : Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
    :
    Stooboy can detect floppy disks which act like a bank card. He needs to check if the PIN-file exists, if exists there is a valid floppy in the drive.

    ****************
    Any questions? Just ask!

    :-) [b][blue]GAASHIUS[/blue][/b] :-)


  • : : : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    : : :
    : : : Stoo
    : : :
    : : Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
    : :
    : Stooboy can detect floppy disks which act like a bank card. He needs to check if the PIN-file exists, if exists there is a valid floppy in the drive.
    :
    : ****************
    : Any questions? Just ask!
    :
    : :-) [b][blue]GAASHIUS[/blue][/b] :-)
    :
    :
    :
    You can use FileExists() to check if the file exists. Or if FileExists() isn't recognized by your compiler you can use the IOResult method, which is slightly more coding. The TP help files include a good example of the IOResult code.
  • : : : : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    : : : :
    : : : : Stoo
    : : : :
    : : : Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
    : : :
    : : Stooboy can detect floppy disks which act like a bank card. He needs to check if the PIN-file exists, if exists there is a valid floppy in the drive.
    : :
    : : ****************
    : : Any questions? Just ask!
    : :
    : : :-) [b][blue]GAASHIUS[/blue][/b] :-)
    : :
    : :
    : :
    : You can use FileExists() to check if the file exists. Or if FileExists() isn't recognized by your compiler you can use the IOResult method, which is slightly more coding. The TP help files include a good example of the IOResult code.
    :
    Yes, pascal is not delphi :-) there isn't any FileExists funcs. Here's one:
    [code]
    function fileexists(f:string):boolean;
    var
    stream:file;
    begin
    if f='' then begin
    exist := false;
    exit;
    end;
    assign(stream,f);
    {$i- }
    reset(stream);
    close(stream);
    {$i+ }
    fileexists:=(ioresult=0);
    end;
    [/code]

    ****************
    Any questions? Just ask!

    :-) [b][blue]GAASHIUS[/blue][/b] :-)


  • : : : : : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    : : : : :
    : : : : : Stoo
    : : : : :
    : : : : Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
    : : : :
    : : : Stooboy can detect floppy disks which act like a bank card. He needs to check if the PIN-file exists, if exists there is a valid floppy in the drive.
    : : :
    : : : ****************
    : : : Any questions? Just ask!
    : : :
    : : : :-) [b][blue]GAASHIUS[/blue][/b] :-)
    : : :
    : : :
    : : :
    : : You can use FileExists() to check if the file exists. Or if FileExists() isn't recognized by your compiler you can use the IOResult method, which is slightly more coding. The TP help files include a good example of the IOResult code.
    : :
    : Yes, pascal is not delphi :-) there isn't any FileExists funcs. Here's one:
    : [code]
    : function fileexists(f:string):boolean;
    : var
    : stream:file;
    : begin
    : if f='' then begin
    : exist := false;
    : exit;
    : end;
    : assign(stream,f);
    : {$i- }
    : reset(stream);
    : close(stream);
    : {$i+ }
    : fileexists:=(ioresult=0);
    : end;
    : [/code]
    :
    : ****************
    : Any questions? Just ask!
    :
    : :-) [b][blue]GAASHIUS[/blue][/b] :-)
    :
    :
    :
    Some Pascal compilers do have FileExists(). Its been a while, but if I remember well, Freepascal does have it.
  • : : : Is there a way to use, say a floppy, as an actual bank card substitute. So that when you insert a floppy disk it acts as a bank card.
    : : :
    : : : Stoo
    : : :
    : : Yes. the easiest way to do this is to place a "pin code"-file on the floppy, and let the user press a key after he inserted the floppy. Sadly there is no way to detect if a floppy is entered, and then run a certain procedure.
    : :
    : Stooboy can detect floppy disks which act like a bank card. He needs to check if the PIN-file exists, if exists there is a valid floppy in the drive.
    :
    : ****************
    : Any questions? Just ask!
    :
    : :-) [b][blue]GAASHIUS[/blue][/b] :-)

    Or if you want added security, you could create/use a non-DOS/WINDOWS disk format so that the disk would be unreadable by DOS or Windows or just not show the bank pin info as a file. Also, you could then encode the data as well using an encryption based apon your PIN #.

    Anyways, before any of this could be done, the program would need to be written.

    Phat Nat

  • I'm wanting to create an account file that holds account information, eg:

    on my atm program it is possible to create a new account. What I don't know is how do I keep adding new accounts to this file?

    Stooboy
  • [b][red]This message was edited by Phat Nat at 2005-5-31 17:36:12[/red][/b][hr]
    : I'm wanting to create an account file that holds account information, eg:
    :
    : on my atm program it is possible to create a new account. What I don't know is how do I keep adding new accounts to this file?
    :
    : Stooboy
    :

    If your account is stored as a record variable, it is quite easy. You can write the record to a file and then use the [b]Append()[/b] procedure to add on to a file if done in [italic]Text mode[/italic] or [b]Reset()[/b] if done in [italic]File Mode[/italic] (preferable). The only problem you'll have is if you need to delete a record, but even this is quite easy.

    You can either have an array of your records or just one and read records from the file one-by-one until you find the one you want. The second way allows a huge size of records without trying to use pointers, etc.

    If you want to delete a record the second method, you would have to copy your data file to another temp file, then copy it back over the original one record at a time and just don't copy the record you want to delete. Then delete the Temp file.

    [code]
    TYPE
    MyRecord = record
    Name : String;
    Age : Byte;
    {...}
    END;
    VAR
    F : File;
    Data : MyRecord;
    X : Byte;

    Begin
    Assign(F,'MYFILE.DAT'); {$I-}
    Reset(F,1);
    If IOResult <> 0 Then Rewrite(F,1);
    X := 0;
    While Not(Eof(F)) Do
    Begin
    Inc(X);
    BlockRead(F,MyRecord,SizeOf(MyRecord));
    WriteLn('Record #',X);
    WriteLn(' * Name = ',Data.Name);
    WriteLn(' * Age = ',Data.Age);
    WriteLn;
    While Keypressed Do Readkey;
    Readkey;
    End;

    WriteLn('Enter Data:');
    Write('Name = ');
    ReadLn(Data.Name);
    If Data.Name <> '' then
    Begin
    WriteLn('Age = ');
    ReadLn(Data.Age);
    Seek(F,FileSize(F));
    BlockWrite(F,MyRecord,SizeOf(MyRecord));
    End;
    End.
    [/code]

    Here's an example of storing & Reading records to a file.

    Phat Nat


  • Thanks for your help doll!

    I want to have a menu that offers users the chance to create a new account or enter their pin number, the latter taking them to withdraw,etc.

    I have created a record to store information such as pin number , current balance.

    I just don't understand how to store users details to file and keep adding to this file as more and more accounts are created, if you know what i mean.

    Stooboy
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories