Advertisement
riggnaros

Mindtap10_11_header

Apr 6th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #pragma once
  2. #include <string>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. class personType
  8. {
  9. public:
  10.     void printName() const;
  11.     void setName(string first, string middle, string last);
  12.     void setFName(string first);
  13.     void setMName(string middle);
  14.     void setLName(string last);
  15.     string getFName() const;
  16.     string getLName() const;
  17.  
  18.     //constructor
  19.  
  20.     personType(string first = "", string middle = "", string last = "");
  21.  
  22.  
  23. private:
  24.     string FName;
  25.     string LName;
  26.     string MName;
  27. };
  28.  
  29.  
  30.  
  31. //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.
  32. //Redefine the class personType so that, in addition to what the existing class does, you can:
  33.  
  34. //xSet the first name only.
  35. //xSet the last name only.
  36. //xStore and set the middle name.
  37.  
  38. //Check whether a given first name is the same as the first name of this person.
  39. //Check whether a given last name is the same as the last name of this person.
  40.  
  41. //Write the definitions of the member functions to implement the operations for this class.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement