Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So, I need to print the info from this class, first and last name, employee ID, payrate, and a calculated pay being from (1+PR)*BP. I

So, I need to print the info from this class, first and last name, employee ID, payrate, and a calculated pay being from (1+PR)*BP. I think I have the getters and setters right but don't know how to print the info. I need it to take the info from the header file, then display the name, ID, Payrate and calculated pay in c++

//header

#include

using namespace std; string Fname[25] = { "Jane", "Bill", "dan", "Frank", "Megan,", "Trip", "Jacob", "Greg", "Joel", };

string Fname[25] = { " Big", " Moore", " Rapeno"," Fitzgareld", " Soh", " Davis", " Hunter", " Gates", " Juie"}

int ID[25] = { 1,2,3,4,5,6,7,8,9 };

double Payrate[25] = { .2, .15, .23, .12, .31, .14, .14, .36, .54};

//////////////////////////////source

#include #include #include "names.h" #include #include #include

using namespace std;

class Workers { private: string Fname; string Lname; int ID; double Payrate; double Basepay;

public: /* Workers(string Fname, string Lname, int ID, double Payrate, double Basepay) { setFname (Fname); setLname (Lname); setID (ID); setPayrate (Payrate); setBasepay (Basepay); }*/ void set(string Fname){ this->Fname = Fname; cout << Fname << endl; } void set(string Lname){ this->Lname = Lname; } void set(int ID) { this-> ID = ID; } void set(double Payrate) { this ->Payrate = Payrate; } void set( double Basepay) { this -> Basepay = Basepay; } string getFname() { return Fname; } string getLname() { return Lname; } int getID() { return ID; } double getPayrate() { return Payrate; } double getBasepay() { return Basepay; } float getCalcPay() { return ((1 + Payrate * Basepay)); } };

int main() { Workers obj1; obj1.setFname();

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions