Skip to content

A comprehensive ATM management system implemented in C that allows users to manage bank accounts with various features including account creation, transactions, and account management.

License

Notifications You must be signed in to change notification settings

oumaoumag/atm-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATM Management System

A comprehensive ATM management system implemented in C that allows users to manage bank accounts with various features including account creation, transactions, and account management.

Features

Core Functionality

  • ✅ User registration and login with duplicate name checking
  • ✅ Create new accounts (savings, current, fixed-term)
  • ✅ View all accounts for a user
  • ✅ Check detailed account information with interest calculations
  • ✅ Make transactions (deposit/withdraw) with validation
  • ✅ Update account information (country/phone)
  • ✅ Remove existing accounts with confirmation
  • ✅ Transfer account ownership between users
  • ✅ Comprehensive input validation and error handling

Security Features

  • Password input masking during login/registration
  • User authentication and authorization
  • Account ownership validation
  • Input sanitization and validation

Getting Started

Prerequisites

  • GCC compiler
  • Make utility
  • Git (for cloning)

Installation

  1. Clone the repository:
git clone https://learn.zone01kisumu.ke/git/oumouma/atm-management-system
  1. Navigate to the project directory:
cd atm-management-system
  1. Compile the project:
make clean
make
  1. Run the application:
./atm

File Structure

.
├── data/
│   ├── users.txt      # User credentials storage
│   └── records.txt    # Account records storage
├── src/
│   ├── main.c         # Main program and menu system
│   ├── auth.c         # Authentication functions
│   ├── system.c       # Core system functions
│   └── header.h       # Function declarations and structures
├── Makefile           # Build configuration
├── test_atm.sh        # Testing guidance script
├── test_interest.c    # Interest calculation verification
└── README.md          # This file

Usage

Once the application is running, you'll see a menu-driven interface. Follow the on-screen prompts to:

  1. Register a new user account or Login with existing credentials
  2. Create new bank accounts (savings, current, fixed-term)
  3. View all your accounts or check detailed account information
  4. Make transactions (deposit/withdraw)
  5. Update account information
  6. Remove accounts or transfer ownership

Default Test Users

  • Alice: password q1w2e3r4t5y6
  • Michel: password q1w2e3r4t5y6

Account Types and Interest Rates

  • Savings: 7% annual interest (calculated monthly: balance × 0.07 ÷ 12)
  • Current: No interest
  • Fixed01: 4% annual interest (1 year term: balance × 0.04)
  • Fixed02: 5% annual interest (2 year term: balance × 0.05 × 2)
  • Fixed03: 8% annual interest (3 year term: balance × 0.08 × 3)

Interest Payment Schedule

  • Savings: Monthly on the deposit day
  • Fixed accounts: Lump sum on maturity date
  • Current: No interest

Transaction Rules

  • Savings/Current accounts: Allow deposits and withdrawals
  • Fixed accounts: No transactions allowed (deposits/withdrawals blocked)
  • Withdrawal validation: Cannot withdraw more than available balance
  • Amount validation: All amounts must be positive

Data Format

users.txt

id name password
0 Alice q1w2e3r4t5y6
1 Michel q1w2e3r4t5y6

records.txt

id userId userName accountId date country phone balance accountType
0 0 Alice 834213 10/10/2012 UK 291231392 1001.20 saving

Testing

Automated Interest Calculation Test

gcc test_interest.c -o test_interest && ./test_interest

Manual Testing Guide

./test_atm.sh

Audit Test Cases

The system passes all audit requirements including:

  1. User registration with duplicate checking
  2. Account creation with proper validation
  3. Interest calculations matching expected values:
    • Saving account ($1001.20): $5.84 monthly interest
    • Fixed01 account ($1001.20): $40.05 total interest
    • Fixed02 account ($1001.20): $100.12 total interest
    • Fixed03 account ($1001.20): $240.29 total interest
  4. Transaction restrictions on fixed accounts
  5. Account removal and ownership transfer

Implementation Details

Key Functions

  • checkAccountDetails(): View account with interest calculations
  • makeTransaction(): Handle deposits/withdrawals with validation
  • updateAccountInfo(): Update country/phone with file persistence
  • removeAccount(): Delete account with confirmation
  • transferOwnership(): Transfer account to another user
  • calculateInterest(): Compute interest based on account type

Error Handling

  • File I/O error checking
  • Input validation for all user inputs
  • Account existence verification
  • User ownership validation
  • Transaction amount validation

License

This project is for educational purposes as part of the Zone01 curriculum.

About

A comprehensive ATM management system implemented in C that allows users to manage bank accounts with various features including account creation, transactions, and account management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published