#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<fstream>
#include<iomanip>
using namespace std;
// Function declarations
void write_account();
void display_account(int);
void modify_account(int);
void delete_account(int);
void display_all();
void deposit_withdraw(int, int);
void intro();
// Class declaration - Account
class Account {
int account_number;
char name[50];
int deposit;
char type;
public:
void create_account();
void show_account() const;
void modify();
void dep(int);
void draw(int);
void report() const;
int get_account_number() const;
int get_deposit() const;
char get_account_type() const;
};
// Function to display an introduction to the Bank Management System
void intro() {
cout << endl << "*******************************";
cout << endl << "** Bank Management System **";
cout << endl << "*******************************" << endl << endl;
}
// Function to create a new account
void Account::create_account() {
cout << "Enter the account number: ";
cin >> account_number;
cout << "\nEnter the name of the account holder: ";
cin.ignore();
cin.getline(name, 50);
cout << "\nEnter the type of account (C(Current)/S(Saving)): ";
cin >> type;
type = toupper(type);
cout << "\nEnter the initial deposit amount: ";
cin >> deposit;
cout << "\nAccount Created..." << endl;
}
// Function to display account details
void Account::show_account() const {
cout << "\nAccount Number: " << account_number;
cout << "\nAccount Holder Name: " << name;
cout << "\nAccount Type: " << type;
cout << "\nAccount Balance: " << deposit;
}
// Function to modify an existing account
void Account::modify() {
cout << "\nAccount Number: " << account_number;
cout << "\nModify Account Holder Name: ";
cin.ignore();
cin.getline(name, 50);
cout << "\nModify Account Type (C(Current)/S(Saving)): ";
cin >> type;
type = toupper(type);
cout << "\nMod
C++ 学籍管理系统
最新推荐文章于 2024-04-02 12:05:17 发布