Skip to content

eltonlazzarin/simple-bank-account

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Simple Bank Account System

A Python-based command-line application that simulates a basic bank account management system with user creation, account management, and transaction features.

Features

  • User Management: Create new users with CPF, name, birth date, and address
  • Account Management: Create and list bank accounts associated with users
  • Transactions:
    • Deposits: Add funds to your account
    • Withdrawals: Withdraw funds with configurable limits
    • Statements: View transaction history and current balance
  • Security Features:
    • Daily withdrawal limit (3 withdrawals maximum)
    • General withdrawal limit (R$ 500)
    • Balance verification
    • Input validation with error handling

Project Structure

simple-bank-account/
├── challenge.py       # Main application file
└── README.md         # This file

Installation

No external dependencies required. This project uses only Python's standard library.

Requirements:

  • Python 3.6 or higher

Usage

To run the application:

python challenge.py

Menu Options

Once the application starts, you'll see the following menu:

================ MENU ================
[d]  Deposit
[w]  Withdraw
[s]  Statement
[nc] New Account
[la] List Accounts
[nu] New User
[q]  Exit
=> 

Step-by-Step Guide

  1. Create a User (Option: nu)

    • Enter CPF (digits only)
    • Enter full name
    • Enter birth date (dd-mm-yyyy)
    • Enter address
  2. Create an Account (Option: nc)

    • Enter the CPF of an existing user
    • Account will be created automatically
  3. Make a Deposit (Option: d)

    • Enter the deposit amount
    • Funds are added to your balance
  4. Make a Withdrawal (Option: w)

    • Enter the withdrawal amount
    • System checks:
      • Sufficient balance
      • Daily limit (R$ 500)
      • Maximum withdrawals (3 per session)
  5. View Statement (Option: s)

    • See all transactions
    • View current balance
  6. List Accounts (Option: la)

    • View all created accounts with details
  7. Exit (Option: q)

    • End the application

Limitations & Rules

  • Withdrawal Limit: Maximum of 3 withdrawals per session
  • Daily Limit: R$ 500 per withdrawal
  • Minimum Amount: Only positive amounts are accepted
  • CPF Validation: System prevents duplicate CPF registration
  • Account Creation: User must exist before creating an account
  • Data Persistence: Data is stored in memory only (lost when exiting)

Example Session

Enter CPF (digits only): 12345678901
Enter full name: João Silva
Enter birth date (dd-mm-yyyy): 15-03-1990
Enter address (street, number - neighborhood - city/state abbreviation): Rua A, 100 - Centro - São Paulo/SP
=== User created successfully! ===

Enter user CPF: 12345678901
=== Account created successfully! ===

Enter deposit amount: 1000.00
=== Deposit completed successfully! ===

Enter withdrawal amount: 200.00
=== Withdrawal completed successfully! ===

No transactions were made.
Balance:  R$ 800.00

Error Handling

The application includes error handling for:

  • Invalid numeric input (non-numeric values)
  • Insufficient balance
  • Exceeded withdrawal limits
  • Exceeded daily withdrawal count
  • Invalid operations (unknown menu options)
  • User not found errors

Future Enhancements

  • Persistent data storage (database or file-based)
  • Transaction history with dates/times
  • Interest calculation
  • Bank transfer functionality
  • Account types (checking, savings)
  • Multi-language support

License

This project is provided as-is for educational purposes.

Author

Elton Lazzarin

Contact

For questions or suggestions, please reach out via GitHub or email.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages