题目概述:
编译银行管理系统。
编译:
#include< iostream>
#include< fstream>
#include< vector>
#include< string>
using namespace std;
class BankAccount
{
public:
BankAccount() {};
BankAccount(int number, string name, double money, int phone);//构造函数
int renum() { return user_number; }
string renam() { return user_name; }
double remon() { return over_money; }
int repho() { return user_phone; }
void DisplayInformation();//展示账户信息
friend ostream& operator << (ostream& Out, BankAccount&p)
{
Out << "身份证; " << p.user_number << "姓名: " << p.user_name << "金额: " << p.over_money << "电话: " << p.user_phone ;
return Out;
}
int user_number;//账号
string user_name;//姓名
double over_money=0;//金额
int user_phone;//电话
};
vector v1;
BankAccount p[1000];
int number_temp;//账号`
string name_temp;//姓名
int phone_temp;//电话
void W_File();//打开输出文件
void DisplayAll();//展示全部账户信息
void CreateAccount();//开户
void Destroy();//销户
void DepoistMoney();//存钱
void WithdrawMoney();//取钱
void Find();//查询个人信息
void W_File()//打开输出文件,文件结尾写数据
{
ofstream outfile(“f1.dat”);
if (!outfile)
{
cerr << “此文件无效!” &l
C++:编译银行管理系统(vector)
最新推荐文章于 2024-08-23 21:04:42 发布