Skip to content

bubalda/coursework_1_programming_1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C Programming - Banking System

Coursework 1 for Programming I (COMP-1312)
Banking System by Mah Han Cheng

Features

Creating new bank accounts

  1. Creates account with:

    • Name (3 to 32 characters)
    • Identification number (12-digit number)
    • Account number (Randomly generated between 10,000 to 1,000,000)
    • Account type (1 = Savings, 2 = Current Account)
    • Amount (Balance default RM 0.00)
  2. Creates a 'database' folder to store accounts

  3. Creates files in the 'database' folder, storing account information using the name "account_number.txt".

Deposit into / Withdraw from registered bank accounts

  1. Deposits to / Withdraws from selected bank accounts
    • Checks if amount to withdraw is valid and not out of bounds (greater than 10 digits) to prevent overflow
    • Checks if balance is enough to withdraw
    • Checks if account contents are correct

Delete bank accounts

  1. Delete the specified bank account from the database (Recovery is not avaliable)

Remittance

  1. Transfers money from one account to another
  2. With remittance fee deducted from the sender:
    • From Current Account to Savings Account (2% fee)
    • From Savings Account to Current Account (3% fee)
    • Checks if amount to withdraw is valid and not out of bounds (greater than 10 digits) to prevent overflow
    • Checks if balance is enough to withdraw
    • Checks if account contents are correct

Code Language and Version

  • C version: c17

Setup

To run this project (Windows):

  1. Install a c compiler (mingw / winlibs) and add the binary directory to path.

  2. To check if the compiler has installed: In Command Prompt (cmd):

    gcc --version
  3. In cmd / powershell, run:

    gcc banking_system_application.c -o banking_system_application      # To compile
  4. To run:

    banking_system_application.exe                # in cmd
    ./banking_system_application.exe              # in powershell
  5. The program should run perfectly now 🎉🎉🎉!!!

To run this project (Linux):

  1. GCC normally comes preinstalled, just run in terminal:

    gcc banking_system_application.c -o banking_system_application && ./banking_system_application
  2. If GCC is not found / installed, run in terminal to install gcc:

    sudo apt install build-essential
  3. and test install with:

    gcc --version

To run this project (MacOS):

  1. Go to App Store and install XCode, Apple's compiler

  2. Go to Terminal and run to install the command line tools of XCode:

    xcode-select --install
  3. The setup should be done. To compile the file, run in Terminal:

    gcc -Wall -o banking_system_application banking_system_application.c    # compile
  4. On newer versions of OS X, you can choose to compile with:

    clang banking_system_application.c -o banking_system_application        # compile
  5. Then run the executable with:

    ./banking_system_application    # run program

Author

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages