0% found this document useful (0 votes)
59 views1 page

"Persontype.H": #Include #Include #Include #Include

This document defines a personType class with methods to set and get a first and last name, and print the full name. The personType class constructor takes in first and last name strings and calls the set methods. Includes headers for I/O, strings, and an external header file personType.h.

Uploaded by

api-346895508
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

"Persontype.H": #Include #Include #Include #Include

This document defines a personType class with methods to set and get a first and last name, and print the full name. The personType class constructor takes in first and last name strings and calls the set methods. Includes headers for I/O, strings, and an external header file personType.h.

Uploaded by

api-346895508
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

//preprocessor directives & headers.

#include <iostream> //utilized to instate basic I/O functionality.


#include <string> //implemented to utilize string datatype.
#include <iomanip> //Required to use various useful manipulators.
#include "personType.h" //references external header file.

//standard library
using namespace std; //allows the use of cout & endl without 'std::' prefix.

void personType::setFirstName(string myFirstName){


firstName = myFirstName;
}

void personType::setLastName(string myLastName){


lastName = myLastName;
}

string personType::getFirstName() const{


return firstName;
}

string personType::getLastName() const{


return lastName;
}

void personType::print() const{


cout << "\n\t" << firstName << " " << lastName;
}

personType::personType(string myFirstName, string myLastName){


setFirstName(myFirstName);
setLastName(myLastName);
}

You might also like