#include
#include
#include
#include
#include
using namespace std;
Void Login_Menu ()
{
Cout<& lt;" \ t * * * * * * * * * * * * * * * * * * * * * * * * * * family financial assistant * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
//getTime ();
Cout
Cout<& lt;" \ t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
Void the MainMenu ()
{
Cout<& lt;" \ t * * * * * * * * * * * * * * * * * * * * * * * * * * family financial assistant * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
//getTime ();
Cout
Cout<& lt;" \ t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
Cout<& lt;" \ t * * * * * * * * * * * * * * * * * * operational number: please enter your... * * * * * * * * * * * * * * * * * * * * "& lt;
The class User
{
Public:
The User () {}
Void Move (string n, string a)
{
The username=n;
Password=a;
}
String GetUsername () {return the username; }//query name
String GetPassword () {return password; }
Friend class ArrayOfUsers;
Friend void Login (ArrayOfUsers users, int d);
Private:
String username;
String password;
};
The class ArrayOfUsers
{
Public:
ArrayOfUsers (int size) : the size (size) {
The users=new User [size];
}
/* ~ ArrayOfUsers ()
{
The delete [] the users;
} */
The User & amp; {
element (int index)Assert (index>=0 & amp; & Index
}
Void the Add (string n, string a);
Friend class User;
Friend void Login (ArrayOfUsers users, int d);
Private:
int a;
Int size;
User * users;
Static int record_index;
};
Int ArrayOfUsers: : record_index=0;
Void ArrayOfUsers: : Add (string n, string a)
{
The users [record_index]. Username=n;
The users [record_index]. Password=a;//this member function is quite so registered information before, in turn, assigned to the 10 members, create
Record_index + +;//and record_index is used to record a few members assigned a value, whether in login time after contrast consistent user name and password will be used ()
}
Void the Login (ArrayOfUsers users, int d)
{
Login_Menu ();
String username;
String password;
Int login_select;
Bool is_successfully_login=false;
Bool is_account_found=false;
Bool is_password_correct=false;
Int I, h;
String f;
Do {//I want to have made a loop body, here is the login screen, only if the success of landing or choose 3 can exit the loop, so register can also display the login screen, you can choose what to do next
cin> Login_select;
The switch (login_select)
{
Case 1:
for(i=1; i
F=users. Element (I). The GetUsername ();
If (f! H=0="");
The else h=1;
}
If (h==0)
{
Cout & lt; <"There is currently no account in the system, please create the account, after" & lt;
Setbuf (stdin, NULL);//refresh the input buffer
Getline (cin, username);
Cout & lt; <"Password:";
Setbuf (stdin, NULL);//refresh the input buffer
Getline (cin, password);
Cout
Cout & lt; <"Account creation success!"
Cout & lt;