Before the cash machine can be used some account numbers will need to be
set up in the file database.dat. This can be done by compiling and running
dbasesetup.c, with a normal call to the cc compiler :
cc dbasesetup.c –o dbasesetup
Upon running this program you have 2 options to either enter some account
records manually or let the program set up its default accounts. The default accounts
are simply the account numbers 1-9 with the pin for each being the account number
repeated four times, and the balance is the account number multiplied by 1000. So
for account number 5 the details would be :
Account : 5
PIN : 5555
Balance : 5000
You can check the accounts held in database.dat any time by compiling and
running printdbase.c in the same way as dbasesetup.c. This will display all the
account numbers and their details to the screen.
Compiling of the main system requires a link to the curses library :
cc cash_machine.c –o cash_machine –lcurses
Running the program requires no additional options. Operation of the system
is quite simple, to simulate the style of a cash machine keypad all operations can be
performed using the computer keyboards numeric keypad. However the numlock key
must be activated so that the keypad outputs characters.
When prompted for information enter it on the keypad followed by the enter
key to confirm. Any information entered will be visible on the screen except, for
security, pin numbers.
When presented with a menu use the + and – keys to cycle through the options
and enter to confirm choice.
Finally when presented with the information you requested at the end of a
transaction, or if an error message is displayed, hit any key to continue and go back
to the main options screen.