0% found this document useful (0 votes)
9 views3 pages

Bank Management System CPP Project

The document contains a C++ program that defines an 'Account' class for managing bank accounts, allowing operations such as creating, modifying, depositing, and withdrawing funds. It includes a main menu for user interaction with options to manage accounts and perform transactions. The program is designed to be extended with file handling functions for persistent storage of account data.

Uploaded by

zake89982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Bank Management System CPP Project

The document contains a C++ program that defines an 'Account' class for managing bank accounts, allowing operations such as creating, modifying, depositing, and withdrawing funds. It includes a main menu for user interaction with options to manage accounts and perform transactions. The program is designed to be extended with file handling functions for persistent storage of account data.

Uploaded by

zake89982
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

#include <iostream>

#include <fstream>
#include <cstdlib>
using namespace std;

class Account {
int acc_no;
char name[50];
char type;
int balance;

public:
void create_account() {
cout << "Enter Account Number: ";
cin >> acc_no;
cout << "Enter Account Holder Name: ";
cin.ignore();
cin.getline(name, 50);
cout << "Enter Account Type (S/C): ";
cin >> type;
type = toupper(type);
cout << "Enter Initial Deposit (>=500 for Saving, >=1000 for Current): ";
cin >> balance;
cout << "Account Created.
";
}

void show_account() const {


cout << "Account Number: " << acc_no << endl;
cout << "Account Holder: " << name << endl;
cout << "Type: " << type << endl;
cout << "Balance: " << balance << endl;
}

void modify() {
cout << "Modify Account Holder Name: ";
cin.ignore();
cin.getline(name, 50);
cout << "Modify Type (S/C): ";
cin >> type;
type = toupper(type);
cout << "Modify Balance: ";
cin >> balance;
}

void dep(int amt) {


balance += amt;
}

void draw(int amt) {


balance -= amt;
}
void report() const {
cout << acc_no << "" << name << "" << type << "" << balance << endl;
}

int retacno() const {


return acc_no;
}

int retdeposit() const {


return balance;
}

char rettype() const {


return type;
}
};

void write_account();
void display_account(int);
void modify_account(int);
void delete_account(int);
void display_all();
void deposit_withdraw(int, int);

int main() {
char choice;
int num;
do {
cout << "
MAIN MENU
";
cout << "1. New Account
";
cout << "2. Deposit Amount
";
cout << "3. Withdraw Amount
";
cout << "4. Balance Enquiry
";
cout << "5. All Account Holder List
";
cout << "6. Close An Account
";
cout << "7. Modify An Account
";
cout << "8. Exit
";
cout << "Select Your Option (1-8): ";
cin >> choice;
switch (choice) {
case '1': write_account(); break;
case '2': cout << "Enter Account No: "; cin >> num; deposit_withdraw(num, 1); break
case '3': cout << "Enter Account No: "; cin >> num; deposit_withdraw(num, 2); break
case '4': cout << "Enter Account No: "; cin >> num; display_account(num); break;
case '5': display_all(); break;
case '6': cout << "Enter Account No: "; cin >> num; delete_account(num); break;
case '7': cout << "Enter Account No: "; cin >> num; modify_account(num); break;
case '8': exit(0);
default: cout << "Invalid choice.
";
}
} while (choice != '8');
return 0;
}

// Implementations here (write_account, display_account, etc.)


// You can extend the above code with file handling functions.

You might also like