This C++ console application simulates basic ATM (Automated Teller Machine) operations on user accounts. It provides functionality to:
- Create new accounts with name and 10‑digit card number
- Deposit funds (adds a 1% bonus to each deposit)
- Withdraw funds (charges a 3% fee on withdrawals)
- Transfer funds between accounts (charges 1.5% fee on sender, 1.5% bonus on receiver)
- Display account information
The program maintains up to 100 accounts in memory, each with a name, card number, and balance.
-
User Input Validation:
- Names: Only letters and spaces, length between 3 and 100.
- Card Numbers: Exactly 10 digits, not all identical.
- Monetary Values: Numeric input (floats) only.
-
Fees & Bonuses:
- Deposits: +1% on deposited amount.
- Withdrawals: 3% fee.
- Transfers: 1.5% fee on sender, 1.5% bonus to receiver.
-
Error Handling:
- Re-prompts up to 2–3 attempts for invalid account numbers or operations.
- Prevents operations when funds are insufficient.
-
Menu‑Driven Interface:
- Presents a 5‑option main menu: Create, Deposit, Transfer, Withdrawal, Exit.
-
class ATM: Encapsulates account data (acc_name,card_no,amount) and member functions:create_new_acc(...)deposit(...)withdrawal(...)transfer(...)print_acc_data()get()to return the card number
-
Utility Functions (global scope):
checkname(),checkdigit(),checksamedigit()for input validationcheck_float(),char_to_float()to parse and validate monetary values- Account lookup helpers:
getaccount(),sendingacc(),receivingacc() display()for menu printingcheck_operation_no()validates menu choice
-
Global Variables:
ATM accounts[100]: Fixed-size array for account objectsint account_counter: Tracks number of created accounts- Temporary buffers for user input (
acc_number,value,operation_no,name)
-
Requirements:
- C++11 or later compiler (e.g.,
g++,clang++)
- C++11 or later compiler (e.g.,
-
Build:
g++ -std=c++11 -o atm_app main.cpp
- Follow on‑screen menu prompts.
- Enter numeric choices (1–5) to select operations.
- Provide valid account/name/value inputs when prompted.