⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.cpp

📁 为SSD5课程《数据结构与算法》中的练习
💻 CPP
字号:
#include "Client.h"
#include "Date.h"

//Default constructor which initializes the private data members to default values 
Client::Client(void):fname(""),lname(""),email(""),passwd(""){}

//Accepts parameters to initialize the private data members 
Client::Client (string &ifname, string &ilname, string &iemail, string &ipasswd){
	fname=ifname;
	lname=ilname;
	email=iemail;
	passwd=ipasswd;
}

//Makes a copy of a Client object 
Client::Client(Client const &c){
	fname=c.fname;
	lname=c.lname;
	email=c.email;
	passwd=c.passwd;
}

//Accessors and mutators which provide access to the private data members
//Set the value of the private data members 
void Client::setFname(const string&f){fname=f;}
void Client::setLname(const string&l){lname=l;}
void Client::setEmail(const string&e){email=e;}
void Client::setPasswd(const string&p){passwd=p;}

//Return the value of the private data members 
string Client::getFname () const{return fname;}
string Client::getLname () const{return lname;}
string Client::getEmail () const{return email;}
string Client::getPasswd () const{return passwd;} 

//Returns true if the invoking object's password matches the password given in the parameter
bool Client::verifyPasswd(string pass){
	return(passwd==pass);
}

//This method reads a Client object from an input stream
istream &operator>>(istream &stream, Client &c){
	stream>>c.getFname ()>> "\n" >>c.getLname ()>> "\n"
	      >>c.getEmail()>> "\n" >>c.getPasswd()>> "\n";
	return stream;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -