subject
Computers and Technology, 23.11.2019 00:31 dre4232

Staffmemberparser class
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)
the parsestringtomember function's argument will be a string in the following format:
for a volunteer, type/firstname/lastname/employeeid
for a full time employee, type/firstname/lastname/emloyeeid/r ate/bonus
for an hourly employee, type/firstname/lastname/emloyeeid/r ate/hoursworked
the staffmemberparser will parse this string, pull out the information, allocates memory dynamically to a new object of one of volunteer, fulltimeemployee, or hourlyemployee using their constructor with attributes of the object (depending on whether the first substring is volunteer, fulltimeemployee, or hourlyemployee), and return it to the calling function. the type will always be present and always be one of volunteer, fulltimeemployee, and hourlyemployee. you may add other functions to the volunteer, fulltimeemployee, and hourlyemployee classes in order to make your life easier.
based on code here-
//staffmember parent class
//parent class
#include
#include
using namespace std;
#ifndef staffmember_h
#define staffmember_h
class staffmember {
protected:
string firstname, lastname, memberid;
double pay;
public:
staffmember() {
firstname = "? ", lastname = "? ", memberid = "? ";
pay = 0.0;
}
staffmember(string firstname, string lastname, string memberid) {
this-> firstname = firstname;
this-> lastname = lastname;
this-> memberid = memberid;
}
string getmemberid() {
return memberid;
}
virtual void computepay() {
pay = 0.0;
}
virtual void printinfo() {
printf("\nfirst name: \t\t%s\nlast name: \t\t%s\nmember id: \t\t%s\npay: \t\t%lf\n",
firstname, lastname, memberid, pay);
}
~staffmember() {
cout < < "staff member " < < getmemberid() < < " is getting destroyed." < < endl;
}
};
#endif
//child class (example: hourlyemployee)
#include
#include
#include "staffmember. h"
using namespace std;
#ifndef hourlyemployee_h
#define hourlyemployee_h
class hourlyemployee : public staffmember {
protected:
double rate;
int hoursworked;
public:
hourlyemployee() : staffmember() {
rate = 0.0;
hoursworked = 0;
}
hourlyemployee(string firstname, string lastname, string memberid, double rate, int hoursworked)
: staffmember(firstname, lastname, memberid) {
this-> rate = rate;
this-> hoursworked = hoursworked;
}
virtual void computepay() {
pay = rate * hoursworked;
}
virtual void printinfo() {
staffmember: : printinfo();
}
};
#endif

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
Describe in pseudocode an algorithm that given an integer n and a linked list of elements increases the linked list by a factor of n by replacing each element in the original list with n copies of that element. for example, if l: [18, 7, 4, 24, 11] and n = 3 the resulting list should be l: [18, 18, 18, 7, 7, 7, 4, 4, 4, 24, 24, 24, 11, 11, 11]. if the value of n is less than or equal to 0, the list should be empty after the call. what’s the running time of your algorithm?
Answers: 3
question
Computers and Technology, 22.06.2019 03:50
You are working as a security analyst in a company xyz that owns the whole subnet range of 23.0.0.0/8 and 192.168.0.0/8. while monitoring the data, you find a high number of outbound connections. you see that ip's owned by xyz (internal) and private ip's are communicating to a single public ip. therefore, the internal ip's are sending data to the public ip. after further analysis, you find out that this public ip is a blacklisted ip, and the internal communicating devices are compromised. what kind of attack does the above scenario depict?
Answers: 3
question
Computers and Technology, 23.06.2019 04:00
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x,y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documentation/point2d.html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
Answers: 1
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
You know the right answer?
Staffmemberparser class
the staffmemberparser class is a utility class that will be used to c...
Questions
question
Mathematics, 17.03.2020 20:39
question
Mathematics, 17.03.2020 20:39
question
English, 17.03.2020 20:39
Questions on the website: 13722367