I could sure use any available help on this. I am working on 4 other header/cpp
ID: 3622914 • Letter: I
Question
I could sure use any available help on this. I am working on 4 other header/cpp files related to this. Finding the right functions seems the only issue. I am working from the textbook:
//personType.h
#ifndef H_personType
#define H_personType
#include
using namespace std;
class personType
{
public:
void print() const;
//Function to output the first name and last name
//in the form firstName lastName
void setName(string first, string last);
//Function to set firstName and lastName according to
//the parameters
//Post: firstName = first; lastName = last;
void getName(string& first, string& last);
//Function to return firstName and lastName via the parameters
//Post: first = firstName; last = lastName;
personType(string first, string last);
//Constructor with parameters
//Set firstName and lastName according to the parameters
//Post: firstName = first; lastName = last;
personType();
//Default constructor;
//Intialize firstName and lastName to empty string
//Post: firstName = ""; lastName = "";
private:
string firstName; //store the first name
string lastName; //store the last name
};
#endif
Explanation / Answer
Hope this helps. Let me know if you have any questions. Please rate. :) I'm not 100% sure what you're asking though. I believe you want to see good implementations of the functions you listed, since this is just the header file. The header alone is fine as it is. You should create a new file called "personType.cpp" and put these function definitions in it. //personType.cpp #include "personType.h" #include #include using namespace std; void personType::print() const { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.