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 range of values would result in 10 elements stored in an array?
Paraphin [41]

Answer:

0-9

Explanation:

count 0 as 1

len(0,1,2,3,4,5,6,7,8,9)=10

3 0
3 years ago
Byron wants to use Quick Parts to insert reusable content into a company Word document. Where will he access this option? Design
storchak [24]

Answer:

Insert tab

Explanation:

To use <em>Quick Parts</em>, first go to Insert tab then text group. The icon of <em>Quick Parts</em> is there in the attached picture.You can use the <em>Quick Part Gallery</em> to create, store, and reuse pieces of content, including <em>AutoText</em>, document properties (such as title and author), and fields. These reusable blocks of content are also called <u><em>building blocks</em></u>. <em>AutoText</em> is a common type of building block that stores text and graphics. You can use the <em>Building Blocks Organizer</em> to find or edit a building block

7 0
3 years ago
Read 2 more answers
Write two cin statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a dash,
snow_lady [41]

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

// variables to read birth month and year

int birthMonth,birthYear;

cout<<"Enter the birth month:";

// read the birth month

cin>>birthMonth;

cout<<"Enter the birth Year:";

// read the birth year

cin>>birthYear;

// print the output

cout<<birthMonth<<"-"<<birthYear<<endl;

return 0;

}

Explanation:

Declare two variables "birthMonth" and "birthYear". Read the value of birthMonth and birthYear from user. Then print the birth month and birth year and a dash(-) in between them.

Output:

Enter the birth month:1                                                                                                                                      

Enter the birth Year:2000                                                                                                                                    

1-2000  

Enter the birth month:5                                                                                                                                      

Enter the birth Year:1950                                                                                                                                    

5-1950

6 0
2 years ago
All the employees of Delta Corporation are unable to access the files stored in the server. What do you think is the reason behi
CaHeK987 [17]
C serve crash hope this is correct
5 0
2 years ago
Before u can open and edit a file, you need to zip it, T/F
koban [17]

Answer

False, it is not necessary that you need to zip a file always when you are opening and editing a file

<u><em>PLS MARK BRAINLIEST</em></u>

5 0
3 years ago
Other questions:
  • How to write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator).
    13·1 answer
  • You have informed your users that you need to bring the machine down at the end of the day to perform routine maintenance. Howev
    14·1 answer
  • I would A lot of knowledge and education for computers and <br> Technology
    10·2 answers
  • Create a class named Circle with fields named radius, diameter, and area. Include a constructor that sets the radius to 1 and ca
    7·1 answer
  • What is the Documenter?
    10·1 answer
  • Why do some people argue that tech companies like Apple should do more to address the smartphone addiction problem?
    10·1 answer
  • Whats the formatting of a letter to the editor?​
    12·1 answer
  • What software application is most appropriate to use to create multimedia presentations?
    6·2 answers
  • What is HTML? Write some future of HTML.<br>follow for follow ​
    15·2 answers
  • Years ago when working a helpdesk, the most common question asked, almost daily, was about resetting passwords. What type of kno
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!