Design a class named Employee. The class should keep the following information in member variables:
Employee name
Employee number
Hire Date
Write one or more constructors and the appropriate accessor and mutator functions for the class.
Next, write a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have member variables to hold the following information:
Shift (an integer)
Hourly pay rate (a double)
The workday is divided into two shifts: day and night. The shift variable will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write one or more constructors and the appropriate accessor and mutator functions for the class. Demonstrate the classes by writing a program that uses a ProductionWorker object."
Now I have written out the program, it compiles without errors. However, when I run it It asks the first question "Employees name" after input it errors and closes itself down. Can anyone find where in my code it is causing it to do this please? To be clear, I am not asking for someone to write the program, I have already done this, just need to know why it compiles but does not run all the way through. Thank You!
#include
#include
#include
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();
{

Answers

Answer 1

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;

}

Design A Class Named Employee. The Class Should Keep The Following Information In Member Variables:Employee

Related Questions

computer is an ............. machine because once a task is intitated computer proceeds on its own t ill its completion.​

Answers

Answer:

I think digital,versatile

computer is an electronic digital versatile machine because once a task is initiated computer proceeds on its own till its completation.

Given two regular expressions r1 and r2, construct a decision procedure to determine whether the language of r1 is contained in the language r2; that is, the language of r1 is a subset of the language of r2.

Answers

Answer:

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Explanation:

An algorithm must be guaranteed to halt after a finite number of steps.

Each step of the algorithm must be well specified (deterministic rather than non-deterministic).

Three basic problems:

Given an FA M and an input x, does M accept x?

Is x in L(M)

Given an FA M, is there a string that it accepts?

Is L(M) the empty set?

Given an FA M, is L(M) finite?

Algorithm for determining if M accepts x.

Simply execute M on x.

Output yes if we end up at an accepting state.

This algorithm clearly halts after a finite number of steps, and it is well specified.

This algorithm is also clearly correct.

Testing if L(M) is empty.

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if all strings are rejected.

The "algorithm" is well specified, and it is also clearly correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we use the algorithm for the first problem as a subroutine; you must think in this fashion to solve the problems we will ask.

Correct Algorithm

Simulate M on all strings of length between 0 and n-1 where M has n states.

Output no if and only if all strings are rejected.

Otherwise output yes.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts any strings, it must accept one of length at most n-1.

Suppose this is not true; that is, L(M) is not empty but the shortest string accepted by M has a length of at least n.

Let x be the shortest string accepted by M where |x| > n-1.

Using the Pumping Lemma, we know that there must be a "loop" in x which can be pumped 0 times to create a shorter string in L.

This is a contradiction and the result follows.

COMMENT: There are more efficient algorithms, but we won't get into that.

Testing if L(M) is finite

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if there are a finite number of yes answers.

This "algorithm" is well specified and correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we again use the algorithm for the first problem as a subroutine.

Correct Algorithm

Simulate M on all strings of length between n and 2n-1 where M has n states.

Output yes if and only if no string is accepted.

Otherwise output no.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts an infinite number of strings, it must accept one of length between n and 2n-1.

This builds on the idea that if M accepts an infinite number of strings, there must be a "loop" that can be pumped.

This loop must have length at most n.

When we pump it 0 times, we have a string of length less than n.

When we pump it once, we increase the length of the string by at most n so we cannot exceed 2n-1. The problem is we might not exceed n-1 yet.

The key is we can keep pumping it and at some point, its length must exceed n-1, and in the step it does, it cannot jump past 2n-1 since the size of the loop is at most n.

 This proof is not totally correct, but it captures the key idea.

COMMENT: There again are more efficient algorithms, but we won't get into that.

   Other problems we can solve using these basic algorithms (and other algorithms we've seen earlier this chapter) as subroutines.

       COMMENT: many of these algorithms depend on your understanding of basic set operations such as set complement, set difference, set union, etc.

Given a regular expression r, is Lr finite?

Convert r to an equivalent FA M.

COMMENT: note we use the two algorithms for converting a regular expression to an NFA and then an NFA to an FA.

Test if L(M) is finite.

Output the answer to the above test.

Given two FAs M1 and M2, is L(M1) = L(M2)?

Construct FA M1-2 from M1 and M2 which recognizes the language L(>M1) - L(>M2).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Ten examples of an interpreter

Answers

Answer:

Some popular examples of today's interpreters are:

Interpreter of PythonInterpreter for RubyPerl performerInterpreter for PHPMATLAB UCSD Pascal

Explanation:

An interpreter executes the commands directly in an object code or a machine code, written in a program or a scripting language.

The Interpreter can be referred to as system software that can read and execute the programme instead of interpreting programmes. This interpretation includes high-level source code, pre-compiled programmes and scripts.

It is important to note that the interpreter translates programme by programme line, meaning that one statement is translated on one go. This feature makes it easy for programmers to check any line on debugging but slows the whole programme running time.

The _________ attack exploits the common use of a modular exponentiation algorithm in RSA encryption and decryption, but can be adapted to work with any implementation that does not run in fixed time.
A. mathematical.
B. timing.
C. chosen ciphertext.
D. brute-force.

Answers

Answer:

chosen ciphertext

Explanation:

Chosen ciphertext attack is a scenario in which the attacker has the ability to choose ciphertexts C i and to view their corresponding decryptions – plaintexts P i . It is essentially the same scenario as a chosen plaintext attack but applied to a decryption function, instead of the encryption function.

Cyber attack usually associated with obtaining decryption keys that do not run in fixed time is called the chosen ciphertext attack.

Theae kind of attack is usually performed through gathering of decryption codes or key which are associated to certain cipher texts

The attacker would then use the gathered patterns and information to obtain the decryption key to the selected or chosen ciphertext.

Hence, chosen ciphertext attempts the use of modular exponentiation.

Learn more : https://brainly.com/question/14826269

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?
a. call WriteInteger
b. call WriteDec
c. call WriteHex
d. call WriteInt

Answers

Answer:

d. call WriteInt

Explanation:

Required

Instruction to write to decimal integer

Of the 4 instructions, the call WriteInt instruction is used write to a decimal integer.

This is so, because the WriteInt instruction writes a signed decimal integer to standard output.

This implies that the output will have a sign (positive or negative) and the output will start from a digit other than 0 (i.e. no leading zero)

Use ordinary pipes to implement an inter-process communication scheme for message passing between processes. Assume that there are two directories, d1 and d2, and there are different files in each one of them. Also, each file contains a short-length string of characters. You have to use a parent process that forks two children processes, and have each child process check one of the directories.

Answers

Answer:

Yup

Explanation:

How are dates and times stored by Excel?​

Answers

Answer:

Regardless of how you have formatted a cell to display a date or time, Excel always internally stores dates And times the same way. Excel stores dates and times as a number representing the number of days since 1900-Jan-0, plus a fractional portion of a 24 hour day: ddddd. tttttt

Explanation:

mark me as BRAINLIEST

follow me

carry on learning

100 %sure

Dates are stored as numbers in Excel and count the number of days since January 0, 1900. Times are handled internally as numbers between 0 and 1. To clearly see this, change the number format of cell A1, B1 and C1 to General. Note: apparently, 42544 days after January 0, 1900 is the same as June 23, 2016
Other Questions
Jason combines the two intermediate steps shown. 2 equations. First: upper N subscript 2 (g) plus upper O subscript 2 (g) right arrow 2 upper N upper O (g). Second: 2 upper N upper O (g) plus upper O subscript 2 (g) right arrow 2 upper N upper O subscript 2 (g). Which best describes what Jason should do with the oxygen molecules? What is the cube root of -1,000p12q3?O-1004O - 10ptaO 1004O 10pta Which of the following items requires an internalcooking temperature of 165 F?a. Pork chopsb. Injected meats c. Raw Eggsd. poultry Neglecting air resistance and the weight of the propellant, determine the work done in propelling a five-ton satellite to a height of (a) 100 miles above Earth and (b) 300 miles above Earth. What does a low number on the pH scale say about a solution?A. The solution is neutral.B. The solution is a base.C. The solution is changing.D. The solution is an acid. If 12 girls can sweep a room in 20hours, how many hours will it take 8 girls to perform the same task, assuming they are sweeping at the same rate? Software and technology that allow people to work together on a task are known as How do enzymes function in biological reactions? Observe los datos de la siguiente tabla y resuelva. x -2 -1 0 1 2 3 y 1 3 5 7 9 11 Based on the Pythagorean theorem , find the missing length for each of the given right triangles Which of the following numbers is to the left of 5 2/3 A. 5 5/6B. 5 3/4C.5 7/12D.5 11/12 The senior classes at High School A and High School B planned separate trips to Yellowstone National Park. The senior class at High School A rented and filled 9 vans and 14 buses with 710 students. High School B rented and filled 13 vans and 5 buses with 371 students. Each van and each bus carried the same number of students. Find the number of students in each van and in each bus. Which ratio is not equivalent to 3:6?a. 1:2b. 4:10c. 10:20d. 15:30 Lydiagrace33Image attachedA) 1 point Write an inequality for this graph . Use the shift key and the key or key to type the < or > symbol . *B) Water boils when the temperature is at least 212 degrees F. Which inequality shows this situation ?C) When the temperature drops below 50 degrees F , crickets usually stop chirping . Which inequality shows this situation ? D) Explain the difference between the meaning of a closed circle and an open circle on a graph of an inequality . Which is the correct way to say "Luisa sees the tree."?Luisa ve al rbol.Luisa ve el rbol.Luisa ve a rbol.Luisa ve rbol. In parallelogram LMNP if PQ=21 find QM. Snack food vendors and beer distributors earn some monopoly profits in their local markets but see them slowly erode from various new substitutes. When California voted on legalizing marijuana, which side would you think that California beer distributors were on Ten examples of an interpreter which type of material is the best sound absorber?a. glassb. woodc. concreted. carpet Liz would like to study abroad for a year before graduating from college. She would like to live someplace that is close to her native country of Ireland in terms of development because she will need to use the Internet for many of her classes. She can choose from programs in three countries. What could she use to measure the economic performance of the three countries