C++高手请指教!!

来源:百度知道 编辑:UC知道 时间:2024/06/30 12:59:36
我前不久才刚开始学C++,现在理解起来有些难度,有一道题想了好久也做不出来,只好请高手指教了,先谢了!如下:
做一个银行项目:
1。定义一个结构类型Account帐户;
提示: struct Account{
int id;
char name[20];
char pwd[6];
double balance;
}
Account account;
account.id = generateId();
strcpy(account.name,name);
2。定义一个负责创建帐户ID的函数generateId;
3。定义一个负责存储所有帐户信息的全局变量数组Accounts[];
4。定义一个负责记录帐户实际有效个数的全局变量len;
5。系统其他功能要求都用“真实现”,即不能再只用cout语句来实现。
6。实现系统多用户使用。(即根据指定ID号登录使用)
最好是把代码贴出来供大家一起学习,或者发一份Word文档把代码贴在上面发到我邮箱也行: nhdywn@126.com 多谢啦!

我有整套系统!
# ifndef _ACCOUNTCLASS_
# define _ACCOUNTCLASS_
# include <iostream>
# include <iomanip>
using namespace std;
class Account
{
private :
static double Rate;
static int Count;
int Balance;
char Id[20];
public :
Account();
Account(char* Pc);
Account(char* Pc,int i);
inline void Deposit(int CashInput);
void WithDraw(int Cash);
inline void CheckBalance() const;
inline void CheckRate() const;
{
cout<<"The rate is "<<Rate<<"% now."<<endl;
return;
}
void CheckCount() const;
~Account();
};
Account::Rate=5.8;
Account::Count=0;
Account::Account()
{
cout<<"Set up a user name..."<<endl;
Balance=0;
Account::Count++;
cout<<"You didn't input name now."<<endl;
return;
}
Account::