Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A C++ program simulating bank accounts with deposits, withdrawals, transfers, and interest calculations.

Notifications You must be signed in to change notification settings

rodrigcasio/BankSystem

Repository files navigation

Bank System (C++)

This is a C++ project I made to practice object-oriented programming (OOP) and to build something a bit more complete. The program simulates a simple bank system where you can create accounts, deposit and withdraw money, transfer funds, and apply interest. I put extra effort into this one to really understand how to organize a bigger project.

Features

  • Create accounts with initial balances and interest rates.
  • Perform deposits, withdrawals, and transfers (e.g., 2000ドル from "1010" to "1012").
  • Track transaction histories using vectors.
  • Apply interest to savings accounts (2% for #1010, 9% for #1012).

Purpose

I made this project to get better at using classes, vectors, and OOP ideas in C++. I wanted to see if I could put together a small system that feels more like a real application, and learn how to manage more code and features.

How to Run

This project uses CMake build system generator for easy, cross-platform compilation. Follow these steps from the root directory of the project BankSystem/

  1. Ensure CMake is installed:
  • Make sure you have CMake (version 3.1- or higher please) and a C++ compiler (g++ or clang++) installed on your system.
  1. Generate the build system (configure):
  • Create a separated directory for the build files and run CMake inside it. Keeping source files clean
mkdir build
cd build
cmake ..
  1. Build:
  • Use generated build system (make on Unix-like systems) to compile the executable.
make
  1. Run the program:
  • The executable (BankSystem) will be placed inside the build directory.
./BankSystem

IMPORTANT: Note for windows users:

  • Windows developers have two ways to build the project using CMake.
    • Command line (MSYS2/Cygwin): If you use an environment like MSYS2 or WLS (Windows Subsystem for Linux), you can follow the Standard Build steps above exactly.
    • Visual Studio: CMake can generate a Visual Studio solution. Run CMake from your developer command prompt, specify the generator:
cmake .. -G "Visual Studio 17 2022"

Then, open the generated .sln file and build within Visual Studio IDE.

Sample Output

Account Creation

  • Account #1010 created with balance: 5000ドル.00, Interest rate: 2%
  • Account #1012 created with balance: 3000ドル.00, Interest rate: 9%

Transactions

  • Deposit to #1010: 1000ドル.00

  • New balance for #1010: 6000ドル.00

  • Withdrawal from #1012: 500ドル.00

  • New balance for #1012: 2500ドル.00

  • Transfer from #1010 to #1012: 2000ドル.00

  • New balance for #1010: 4000ドル.00

  • New balance for #1012: 4500ドル.00

Interest Application

  • Applying interest for #1010 (2%): 80ドル.00 -New balance for #1010: 4080ドル.00

  • Applying interest for #1012 (9%): 405ドル.00 -New balance for #1012: 4905ドル.00

Transaction History Screenshot

Bank Output

What I Learned

  • How to use classes and private data to keep things organized and safe.
  • How to use vectors to store lists of transactions that can grow as needed.
  • How to use inheritance and virtual methods for different types of accounts or actions.
  • How to split code into different files and keep things tidy with src/ and include/ folders.
  • How to build a project that feels more like a real-world application, not just a small example.

Author

Rodrigo Casio
My GitHub Profile

About

A C++ program simulating bank accounts with deposits, withdrawals, transfers, and interest calculations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /