C++ 学籍管理系统

本文详细介绍了如何使用C++编程语言设计和实现一个学籍管理系统,涵盖了数据结构、文件操作以及用户交互等方面,旨在提升C++的实际应用能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值