BroBank Project

A command-line banking app you build in C — step by step, week by week. No graphics, just pure code that works.

Laboratory instruments connected by many labeled cables.

Project information

5 weeks

Project duration

 

C

Language

 

CLI

Interface

 

Open the original interactive BroBank explainer

Startup and login

User launches the program. The program greets the user and asks for a PIN to authenticate.

$ ./brobank
==============================
Welcome to BroBank CLI!
Enter PIN:

Main menu

A switch-driven menu appears. Built with a switch() statement — each number maps to one feature.

1  Create account
2  Deposit
3  Withdraw
4  View balance
5  Transfer
6  View history
0  Exit

Deposit flow

User types 2, then enters an amount → the C function deposit() validates input → the balance is updated.

Enter deposit amount:

Input validation

What happens when users make mistakes?

Input validation examples
Input Result
-50 Error: amount must be positive
abc Error: invalid number
99999999 Error: insufficient funds
200.00 Success! Balance updated

Data modeling — Week 4

Structs hold each account’s data. An array of Account structs stores all users in memory — saved to a file in Week 5.

struct Account {
    int id;
    char name[50];
    float balance;
    int pin;
};

Save and load — Week 5

Data survives after the program exits. Accounts, balances and transaction history move between program memory (RAM) and the disk file brobank.dat using fwrite() and fread().

fwrite(&accounts, sizeof(Account), count, file);

Final product

By Week 5 you have a fully working CLI banking app with accounts, transactions, validation, and file persistence.

5 weeks · 6 features · 1 app

Return to C Fundamental Programming · View ESE 124 course resources

Week 4

Model account data

Store each account’s ID, name, balance and PIN in an Account struct. An array of structs holds all users in memory.
Week 5

Save, load and complete BroBank

Use fwrite() and fread() to save accounts, balances and transaction history in brobank.dat. By Week 5, the CLI app combines accounts, transactions, input validation and file persistence.