Howdy, Stranger!

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

Categories

Blocking ATM pin

yoochanyoochan Member Posts: 1
i'm doing a pascal programming. It's about a simple ATM. The problem is when I have to make a pin checking program. What i'm thinking is...If we put the right pin, it will run the next program [the transaction program]. But if we put the false pin, it will repeat the checking program until we put the right pin , but if we put false pin until 3 times, there will be a warning like 'We already blocked your card'...Somebody can help me???
Yoochan

Comments

  • AtexAtex Member Posts: 268
    [code][color=Blue]
    procedure transaction;
    begin
    {your code here}
    end;

    procedure block_card;
    begin
    writeln('We already blocked your card');
    {your code here}
    end;

    function read_pin:boolean; {Returns true if pin is OK}
    begin
    {your code here}
    end;

    {Main program}
    var counter:byte;
    pin_not_ok:boolean;
    begin
    pin_not_ok:=true;
    for counter:=1 to 3 do
    if read_pin then begin transaction;
    pin_not_ok:=false;
    break;
    end;
    if pin_not_ok then block_card;
    end.
    [/color][/code]
Sign In or Register to comment.