This COBOL program implements a simple banking system that allows managing customer accounts and transactions.
The program is divided into several main sections:
- IDENTIFICATION DIVISION: Defines the program name.
- ENVIRONMENT DIVISION: Specifies the input/output files used.
- DATA DIVISION: Declares files and variables.
- PROCEDURE DIVISION: Contains the main program logic.
The program provides the following features:
- Create an Account π¦: Allows creating a new account by entering the account number, first name, and last name.
- Deposit π°: Adds money to an existing account.
- Withdraw π§: Withdraws money from an existing account, ensuring sufficient funds are available.
- Check Balance π: Displays the current balance of a specified account.
- Exit β: Terminates the program execution.
Before running the program, make sure you have a COBOL compiler installed. You can use GnuCOBOL:
On Ubuntu/Debian:
sudo apt update && sudo apt install -y open-cobol
On macOS (via Homebrew):
brew install gnu-cobol
On Windows:
Download and install GnuCOBOL for Windows.
cobc -x main.cob
./main
The program uses two files to store accounts and transactions:
comptes.dat
: Contains account information.transactions.dat
: Stores records of performed transactions.
Ensure these files exist and are accessible before running the program.