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

📄 persontype.h

📁 data+structures+using+c的源码
💻 H
字号:
//personType.h

#ifndef H_personType
#define H_personType

#include <string>

using namespace std;

class personType
{
public:
    void print() const;
	  	 //Function to output the first name and last name.
	  	 //Postcondition: Name is printed in the form 
        //               firstName lastName

    void setName(string first, string last);
		//Function to set firstName and lastName according 	 
		//to the parameters.
	  	//Postcondition: firstName = first; lastName = last

    personType& setFirstName(string first);
	  	//Function to set the first name.
	  	//Postcondition: firstName = first
	 	//     After setting the first name, a reference
	  	//     to the object, that is, the address of the
  		//     object, is returned.

	personType& setLastName(string last);
	  	//Function to set the last name.
	  	//Postcondition: lastName = last
	  	//     After setting the last name, a reference
	  	//     to the object, that is, the address of the
  		//     object, is returned.
    void getName(string& first, string& last);
	  	//Function to return firstName and lastName via 
  		//the parameters
	 	//Postcondition: first = firstName; last = lastName

    personType(string first = "", string last = "");
	  	//Constructor
		//Sets firstName and lastName according to the  
		//parameters
	  	//Postcondition: firstName = first; lastName = last

 private:
    string firstName; //stores the first name
    string lastName;  //stores the last name
};

#endif

⌨️ 快捷键说明

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