ATM Project - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

ATM Project

pullu1pullu1 Posts: 1Member
I'm doing a ATM project for my computer A level. Can anyone give me any useful information about how i can go around it. For now all i did is the option of creating an account, therefore entering in your details, then generating an account, card and pin number. I'm having some problems with the display in that bit, it keeps displaying everything double but it should be ok... Anyway, can you help me with some info and maybe even some source code. The kind of stuff il be doing are the usual standard transactions, which are withdrawl, deposit, balance enquiry, mini statment...
Thanks. Philip.

Comments

  • Phat NatPhat Nat Posts: 757Member
    [b][red]This message was edited by Phat Nat at 2005-11-4 14:38:41[/red][/b][hr]
    : I'm doing a ATM project for my computer A level. Can anyone give me any useful information about how i can go around it. For now all i did is the option of creating an account, therefore entering in your details, then generating an account, card and pin number. I'm having some problems with the display in that bit, it keeps displaying everything double but it should be ok... Anyway, can you help me with some info and maybe even some source code. The kind of stuff il be doing are the usual standard transactions, which are withdrawl, deposit, balance enquiry, mini statment...
    : Thanks. Philip.
    :

    Your double problem is probably that you are using read() or ReadLn() and then using WriteLn() afterwards. Just guessing here, but if so, I figure you are doing it that way so that you can mask the PIN # with '*' characters.
    Anyways, the next step would be (if required in your project) to save the account info to a file. I would have two procedures. One fr saving and one for Loading account info.
    Hopefully you are using Objects or Records to store your data, if not it is easily converted and then that makes it easier for Loading & Saving as well.

    Let's say you have a record like so:
    [code]
    TYPE
    AccountInfo = record
    CardNumber : String[16];
    PinNumber : LongInt;
    Balance : LongInt;
    End;

    VAR
    Account : AccountInfo;
    [/code]

    Then you can Save like this:
    [code]
    PROCEDURE SaveInfo;
    Begin
    Assign(F,'ACCOUNT.DAT');
    {$I-} Reset(F,SizeOf(AccountInfo)); {$I+}
    If IOResult <> 0 Then
    Rewrite(F,SizeOf(AccountInfo));
    Seek(F,FileSize(F));
    BlockWrite(F,Account,1);
    Close(F);
    End;
    [/code]

    Of Course this doesn't take into account that the card may already exist in the file, so you would want to read through the file first to see if the card exists and then overwrite it if it does. Anyways, give it a try and post when you get stuck.

    Phat Nat



Sign In or Register to comment.