Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <string>
- #include <iostream>
- using namespace std;
- class personType
- {
- public:
- void printName() const;
- void setName(string first, string middle, string last);
- void setFName(string first);
- void setMName(string middle);
- void setLName(string last);
- string getFName() const;
- string getLName() const;
- //constructor
- personType(string first = "", string middle = "", string last = "");
- private:
- string FName;
- string LName;
- string MName;
- };
- //Example 10-10 defined a class personType to store the name of a person. The member functions that we included merely print the name and set the name of a person.
- //Redefine the class personType so that, in addition to what the existing class does, you can:
- //xSet the first name only.
- //xSet the last name only.
- //xStore and set the middle name.
- //Check whether a given first name is the same as the first name of this person.
- //Check whether a given last name is the same as the last name of this person.
- //Write the definitions of the member functions to implement the operations for this class.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement