Skip to content

sarafouad02/ATMModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

ATM Console Application

Project Overview

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.

Key Features

  • 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.

Code Structure

  • 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 validation
    • check_float(), char_to_float() to parse and validate monetary values
    • Account lookup helpers: getaccount(), sendingacc(), receivingacc()
    • display() for menu printing
    • check_operation_no() validates menu choice
  • Global Variables:

    • ATM accounts[100]: Fixed-size array for account objects
    • int account_counter: Tracks number of created accounts
    • Temporary buffers for user input (acc_number, value, operation_no, name)

Build & Run Instructions

  1. Requirements:

    • C++11 or later compiler (e.g., g++, clang++)
  2. 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.

About

I created an ATM model to to implement key banking functions such as withdrawing, depositing, and transferring funds.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages