Hello! Thank you for taking the time to help me out! I am working on a program that maintains information about staff members, such as volunteers, and full time and hourly employees. I am having two problems with the program.
First, I have most of the code written already, except for the header file that is supposed to parse a string for the other header files. I really don't know how to do this file, because I am unsure how to tokenize the input string. The file is described in the assignment documentation as follows:
The StaffMemberParser class is a utility class that will be used to create a pointer to a staff member object (one of a volunteer object, a full time employee object, and an hourly employee object) from a parsable string. The StaffMemberParser class object will not be instantiated. It must have the following public function:
static StaffMember * parseStringToMember(string lineToParse)
Here is what I have so far for that file, which isn't much:
// StaffMemberParser.h
// protections
#ifndef StaffMemberParser_H
#define StaffMemberParser_H
using namespace std;
class StaffMemberParser
{
static StaffMember * parseStringToMember(string lineToParse)
{
}
};
#endif
Second, I am getting an error when I compile the files I do have done, which does not relate to this file at all. The error is as follows:
23 StaffMember.h expected `)' before ',' token
Why am I getting this error? How can I fix it? Here is the StaffMember.h file for your reference:
// StaffMember.h
// Assignment #: 7
// Name: Rebecca Kreutzberg
// Email Address: rkreutzb@asu.edu
// protections
#ifndef StaffMember_H
#define StaffMember_H
using namespace std;
class StaffMember
{
// protected variables
protected:
string firstName;
string lastName;
string memberId;
double pay;
// public functions
public:
StaffMember(string1, string2, string3)
{
firstName = string1;
lastName = string2;
memberId = string3;
pay = 0.0;
}
string getMemberId()
{ return memberId; }
virtual void computePay() = 0;
virtual void printInfo()
{ cout << "\nFirst name:\t\t" << firstName << "\nLast name:\t\t" << lastName << "\nMember ID:\t\t" << memberId << "\nPay:\t\t\t$" << pay << "\n" << endl; }
};
#endif
Thank you in advance for any help you can provide!!