This application consists of two executables, atm
and bank
, which are built using Rust.
- Rust: You can download Rust from the official website.
To compile the program, navigate to the directory containing the source code and run the following command:
cargo build --release
This will create the executable files atm
and bank
in the target/release
directory.
To run the bank
executable, use the following command:
./target/release/bank [-p <port>] [-s <auth-file>]
Replace <port>
with the port number you want the bank server to listen on, and <auth-file>
with the path to the file containing the authentication information.
To run the atm
executable, use one of the following commands depending on the operation you want to perform:
-
Check Balance
./target/release/atm [-s <auth-file>] [-i <ip-address>] [-p <port>] [-c <card-file>] -a <account> -n <balance>
-
Deposit Money
./target/release/atm [-s <auth-file>] [-i <ip-address>] [-p <port>] [-c <card-file>] -a <account> -d <amount>
-
Withdraw Money
./target/release/atm [-s <auth-file>] [-i <ip-address>] [-p <port>] [-c <card-file>] -a <account> -w <amount>
-
Get Account Details
./target/release/atm [-s <auth-file>] [-i <ip-address>] [-p <port>] [-c <card-file>] -a <account> -g
In these commands, replace <auth-file>
with the path to the file containing the authentication information, <ip-address>
with the IP address of the bank server, <port>
with the port number of the bank server, <card-file>
with the path to the file containing the card information, <account>
with the account name, <balance>
with the balance amount, and <amount>
with the deposit or withdrawal amount.