1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nutka1998 [239]
2 years ago
5

Design a class named Employee. The class should keep the following information in member variables:

Computers and Technology
1 answer:
Paha777 [63]2 years ago
7 0

Answer:

Here is the code.

Explanation:

#include <iostream>

#include <cstdlib>

#include <string>

#include <iomanip>

using namespace std;

class Employee

{

private:

string employeeName;

int employeeNumber;

int hireDate;

public:

void setemployeeName(string employeeName);

void setemployeeNumber(int);

void sethireDate(int);

string getemployeeName() const;

int getemployeeNumber() const;

int gethireDate() const;

Employee();

};

void Employee::setemployeeName(string employeeName)

{

employeeName = employeeName;

}

void Employee::setemployeeNumber(int b)

{

employeeNumber = b;

}

void Employee::sethireDate(int d)

{

hireDate = d;

}

string Employee::getemployeeName() const

{

return employeeName;

}

int Employee::getemployeeNumber() const

{

return employeeNumber;

}

int Employee::gethireDate() const

{

return hireDate;

}

Employee::Employee()

{

cout << "Please answer some questions about your employees, ";

}

class ProductionWorker :public Employee

{

private:

int Shift;

double hourlyPay;

public:

void setShift(int);

void sethourlyPay(double);

int getShift() const;

double gethourlyPay() const;

ProductionWorker();

};

void ProductionWorker::setShift(int s)

{

Shift = s;

}

void ProductionWorker::sethourlyPay(double p)

{

hourlyPay = p;

}

int ProductionWorker::getShift() const

{

return Shift;

}

double ProductionWorker::gethourlyPay() const

{

return hourlyPay;

}

ProductionWorker::ProductionWorker()

{

cout << "Your responses will be displayed after all data has been received. "<<endl;

}

int main()

{

ProductionWorker info;

string name;

int num;

int date;

int shift;

double pay;

cout << "Please enter employee name: ";

cin >> name;

cout << "Please enter employee number: ";

cin >> num;

cout << "Please enter employee hire date using the format \n";

cout << "2 digit month, 2 digit day, 4 digit year as one number: \n";

cout << "(Example August 12 1981 = 08121981)";

cin >> date;

cout << "Which shift does the employee work: \n";

cout << "Enter 1, 2, or 3";

cin >> shift;

cout << "Please enter the employee's rate of pay: ";

cin >> pay;

info.setemployeeName(name);

info.setemployeeNumber(num);

info.sethireDate(date);

info.setShift(shift);

info.sethourlyPay(pay);

cout << "The data you entered for this employee is as follows: \n";

cout << "Name: " << info.getemployeeName() << endl;

cout << "Number: " << info.getemployeeNumber() << endl;

cout << "Hire Date: " << info.gethireDate() << endl;

cout << "Shift: " << info.getShift() << endl;

cout << setprecision(2) << fixed;

cout << "Pay Rate: " << info.gethourlyPay() << endl;

system("pause");

return 0;

}

You might be interested in
Which of the listed tools would a barber likely use in the following scenario?
Charra [1.4K]

Answer:

Please elaborate more your question so I can answer your question accurately.

Explanation:

6 0
2 years ago
must understand both art and engineering. a. industrial designer b. environmental designer c. interior designer d. graphic desig
enot [183]
It's d. Graphic designer because they design things on the computer with code
7 0
3 years ago
Using refracted laser light to store data on a photoreceptive substrate is essentially how ___ storage works. Theoretically this
Alina [70]

Answer:

I try to search the answer but I couldn't find it

4 0
3 years ago
What command would you issue from a command prompt to see a listing of the computers in your workgroup?
ololo11 [35]
<span>Net View is the command issue from a command prompt to see a listing of the computers in your workgroup.It will display the list of domains,computers resources which have been shared by the specified computer then it will list all computers currently in our domain.The syntax for net view using command prompt NET VIEW [\\computername [/CACHE] | [/ALL] | /DOMAIN[:domainname]].</span>
8 0
3 years ago
What will be the results from running the following code?
kari74 [83]

Answer:syntax error

Explanation:

Correct on edg 2021

4 0
2 years ago
Other questions:
  • Read each scenario, and then select the best wireless device for the worker’s needs. A trucker is constantly on the road. He fre
    8·2 answers
  • Help PLEASE (in attachment)
    8·1 answer
  • HELP PLEASE!!! I do online school, someone is in another state wanting to help me. No not do my work for me but view what I view
    6·1 answer
  • In online education is intrinsically related to equity. Professionalism Communication Accessibility
    8·2 answers
  • Eun-Joo is working on a circuit board. There is no electrical current flowing through a certain switch on the circuit board.
    9·2 answers
  • in Python we use IDE ( lntegrated Dvelopment Environment ) to write down the program data points of difference between script mo
    13·1 answer
  • Anyone want to play mine mincraft w/ me?
    9·1 answer
  • Which characteristics support an agile mis infrastructure?
    6·1 answer
  • The type value ____ for the input element may cause modern browsers to validate entries to ensure that they are valid web addres
    14·1 answer
  • Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know th
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!