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]
3 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]3 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
"Margaret has $3,200 cash after selling off her television, DVD player, and computer. She has debts of $4,800 owing to the follo
serg [7]

Answer: Hyatt's  will be able to collect $1,365

Explanation: Composition Agreement is a kind of agreement reached between a debtor and its creditors. it a kind of agreement whereby the debtor and creditors agree to collect a percentage of their debts to fully settle their debts from the creditor.

For instance Margaret with a cash of $3,200 to settle a debt of $4,800.

In this case Margaret can decide to pay 65% of the total debts to settle the final debts. Here, Hyatt's  will be able to collect $1,365 as full settle of his debt.

5 0
3 years ago
Why does my hp computer keep freezing when i move it?
ehidna [41]
There is probably a loose or broken cable, most likely connected to the hard drive
3 0
3 years ago
‘‘Anyone in the developed world can publish anything anytime, and the instant it is published, it is globally available and read
taurus [48]
The internet made huge changes to the way news and information were shared. While it was faster to use newspapers or magazines to spread information than it was to simply tell people, they were still very inefficient compared to today's technology. With the internet today, anyone can come online and learn about what's happening in the far corners of the world. Take your question, for instance. If there was no internet, you might have to post a notice somewhere, which could take days to answer. However, since you were able to post this on the internet, I'm able to answer it within five minutes of it being posted.
8 0
3 years ago
The physical components of a computer are called hardware
jasenka [17]

Answer: Yes

Explanation:

Computer hardware includes the physical parts of a computer, such as the case, central processing unit (CPU), monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard. It is very important to have these parts, without them, your computer will not work.

4 0
3 years ago
PLEASE HELP!!!!!! I NEED THIS NOW!!!!!!!
Sonbull [250]

Answer: I believe it is a web server.

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Digital art is created by using
    6·1 answer
  • What are the Predictive tasks in Data Mining?
    13·1 answer
  • An indicator is a comprehensive analysis of critical information
    8·1 answer
  • How do u beat sonic unleashed
    8·1 answer
  • Employers will check you out on social media sites like Facebook, MySpace, and Twitter.
    6·2 answers
  • The Domain Name Service is what translates human-readable domain names into IP addresses that computers and routers understandA.
    11·1 answer
  • #Write a function called "in_parentheses" that accepts a
    5·1 answer
  • Consider the following two tables where EmployeeNum is primary key in both tables. What is the result of combining the two table
    15·1 answer
  • Which of the following rights is NOT guaranteed by copyright?
    11·1 answer
  • Which statement about digital certificates is​ FALSE? A. The CA verifies a digital certificate​ user's identity online. B. Digit
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!