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
When testing a game, why might you consider throttling the game’s “frames per second”?
Ivenika [448]

Answer:

because if you throttle it then

you can make sure it's okay

4 0
2 years ago
I WILL GIVE BRAINLIEST TO WHOEVER HELPS ME
solniwko [45]
Press the windows key and type touchpad or press the windows key + I to open settings then touch pad
4 0
2 years ago
What statement is used to close a loop started with a for statement?
Zigmanuir [339]
I believe you could use a statement like "the end" but if I'm wrong could you explain please?
6 0
4 years ago
The commands available from a menu may change as a result of a user's actions.
kiruha [24]
True. Say we have 3 options and the three options are: create a text file, move the text file and rename the text file. But the user wants to delete the file. But he can't because there is no option for deletion. So his best option is to move the text file to another folder. To at least get it out of the way.
8 0
3 years ago
write a method that returns a string in the form of hour:minute:second for a given total seconds using the following header: pub
Monica [59]

A method that returns a string in the form of the hour: minute: second for a given total second that utilizes the given header is as follows:

class Convert {

public static String format(long seconds) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter total seconds: ");

int secs = sc.nextInt();

int hours = secs / 3600;

int minutes = (secs % 3600) / 60;

int seconds = (secs % 3600) % 60;

String timeFormat = hours + ":" + minutes + ":" + seconds;

return timeFormat;

}

}

<h3>What is the String function?</h3>

The string function may be characterized as the type of function in a computer's programming function that may significantly have a non-numerical result.

String functions are typically utilized in computer programming languages in order to manipulate a string or query information about a string successfully.

Therefore, a method that returns a string in the form of the hour: minute: second for a given total second that utilizes the given header is well described above.

To learn more about Header, refer to the link:

brainly.com/question/2329500

#SPJ1

5 0
1 year ago
Other questions:
  • Windows uses a memory-management technique known as ________ to monitor which applications you frequently use and preloads them
    15·1 answer
  • Which javascript method should you use if you want to specify a message string to appear on your web page as it loads?
    13·1 answer
  • Which of the following is an Important criterion for evaluating the effctiveness of a graphic organizer
    14·2 answers
  • Which of the following mountain ranges stretches from Alabama to Canada?
    10·1 answer
  • Which of the following might not exist in a URL?
    10·2 answers
  • PLEASE HELP ON TECHNOLOGY
    8·1 answer
  • A pre-design document you can use to create a new project quickly
    5·1 answer
  • Use the {blank} to view your presentation the way an audience will see it.
    13·2 answers
  • Write a Boolean expression that tests if the value stored in the variable num1 is equal to the value stored in the variable num2
    10·1 answer
  • Which testing is used for a program's individual components functionality testing?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!