Question: Class definitions (interfaces) are stored in a header file, a file with the suffix .h Create the class definition for the Person class in file

Class definitions (interfaces) are stored in a header file, a file with the suffix .h

Create the class definition for the Person class in file Person.h as follows:

 #ifndef PERSON_H #define PERSON_H #include  using namespace std; class Person { public: Person(); Person(string fname, string lname, string cname); string getFirstName(); string getName(); string getLastName(); string getCompany(); private: string firstname; string lastname; string company; }; // Person #endif

The methods (member functions) of a class are stored in a file with the same name but with the suffix .cpp.

Complete the member function definitions in the file Person.cpp below. This file should begin with:

 #include "Person.h" #include  using namespace std; Person::Person() { firstname = ""; lastname = ""; company = ""; } // constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!