This repository is only for the instrucution how to clone this project, build and run tests. I implemented a simple ATM controller using console UI. The user database is stored as text file /data/account_list.txt
. Any questions are welcome, I attached my contact to the end of this file. Plus I wrote a demo for running this code.
cmake
: more than3.0.2
gcc, g++
: more than9
- Ubuntu 20.04, Standard C++17
git clone https://github.com/bigbigpark/ATMController.git
cd ATMController
mkdir build && cd build
cmake ../
make
./main
Instead of the process that inserts the card and presses the PIN number, I used std::cin
from the user on console. Users can input the identification number of card and its password after the program starts. If they are correct information, the customer do following three tasks using our ATM controller.
- Check the balance
- Deposit the cash into the account
- Withdraw the money from it
I considered every wrong input command such as any punctuation and mathmatical marks, blank, negative number etc.
Like a real bank system I managed all customer's account as a format of txt file. You can check all data at account_list.txt. Each row means every other account seperated by delimiter ,
meaning card_id, password and the balance.
It is most important to keep confidential personal information in a real bank system but to ease the implementation I used text file-based user database which can be found here same as below picture.
I'll use the first row of it for this demo.
- card id : 12345678
- password : 1111
- balance : 3050
Begin the demo with ./main
.
Input the card information (id + password).
If both are correct, the user can continue the steps.
From this process, the user can access own bank accout. The three main function is avaliable. 1) Check the balance, 2) Deposit and 3) Withdraw. Also, User can terminate the ATM controller with doing nothing.
As you already know, the user has $3,050.
You can push the money into your account.
The total balance is $8,050 now.
Also, you can pull out the money from it.
The total balance is $6,816.
Whenever you type no
or 0
to terminate a ATM controller with corressponding terminal, the program ends with closing ments.
The last balance after several accessing the account is $6,816. Our ATM service automatically saves the changes and manages it as a format of text file.
Author: SeongChang Park
Email: scsc1125@gmail.com