SlideShare a Scribd company logo
1 of 7
Download to read offline
This code has nine errors, but I don't know how to solve it.
Please give me a code that resolves all errors and executes well. Please provide the code for
each file name.
( Employee.h, Employee.cpp, ProductionWorker.h, ProductionWorker.cpp,
TeamLeader.h, TeamLeader.cpp, Main.cpp)
Employee.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
class Employee
{
private:
string employeeName;
string employeeNumber;
string hireDate;
public:
Employee(); // default constructor
Employee(string name, string number, string date); // constructor with parameters
void setEmployeeName(string employeeName); // set employee name
void setEmployeeNumber(string employeeNumber); // set employee number
void setHireDate(string hireDate); // set hire date
string getEmployeeName() const; // get employee name
string getEmployeeNumber() const; // get employee number
string getHireDate() const; // get hire date
};
Employee.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
Employee::Employee()
{
cout << "Please answer some questions about your employees. " << endl;
}
// Constructor with parameters
Employee::Employee(string name, string number, string date)
{
employeeName = name;
employeeNumber = number;
hireDate = date;
}
// Set employee name
void Employee::setEmployeeName(string name)
{
employeeName = name;
}
// Set employee number
void Employee::setEmployeeNumber(string number)
{
employeeNumber = number;
}
// Set hire date
void Employee::setHireDate(string date)
{
hireDate = date;
}
// Get employee name
string Employee::getEmployeeName() const
{
return employeeName;
}
// Get employee number
string Employee::getEmployeeNumber() const
{
return employeeNumber;
}
// Get hire date
string Employee::getHireDate() const
{
return hireDate;
}
ProductionWorker.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
using namespace std;
class ProductionWorker : public Employee
{
private:
int shift;
int hourlyPay;
public:
ProductionWorker(); // default constructor
ProductionWorker(string name, string number, string date, int s, int pay); // constructor with
parameters
void setShift(int shift); // set shift
void setHourlyPay(int pay); // set hourly pay
int getShift() const; // get shift
int getHourlyPay() const; // get hourly pay
};
ProductionWorker.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "ProductionWorker.h"
// Default constructor
ProductionWorker::ProductionWorker()
{
cout << "Your responses will be displayed after all data has been received." << endl;
}
// Constructor with parameters
ProductionWorker::ProductionWorker(string name, string number, string date, int s, int pay)
: Employee(name, number, date)
{
shift = s;
hourlyPay = pay;
}
// Set shift
void ProductionWorker::setShift(int s)
{
shift = s;
}
// Set hourly pay
void ProductionWorker::setHourlyPay(int pay)
{
hourlyPay = pay;
}
// Get shift
int ProductionWorker::getShift() const
{
return shift;
}
// Get hourly pay
int ProductionWorker::getHourlyPay() const
{
return hourlyPay;
}
TeamLeader.h
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "ProductionWorker.h"
using namespace std;
class TeamLeader : public ProductionWorker
{
private:
int monthlyBonus;
int requiredTrainingHours;
int attendedTrainingHours;
public:
TeamLeader();
TeamLeader(string name, string number, string date, int s, int pay, int bonus, int
reqTrainingHours, int attTrainingHours);
void setMonthlyBonus(int bonus);
void setRequiredTrainingHours(int hours);
void setAttendedTrainingHours(int hours);
int getMonthlyBonus() const;
int getRequiredTrainingHours() const;
int getAttendedTrainingHours() const;
};
TeamLeader.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "TeamLeader.h"
TeamLeader::TeamLeader()
{
cout << "Your responses will be displayed after all data has been received." << endl;
}
TeamLeader::TeamLeader(string name, string number, string date, int s, int pay, int bonus, int
reqTrainingHours, int attTrainingHours)
: ProductionWorker(name, number, date, s, pay)
{
monthlyBonus = bonus;
requiredTrainingHours = reqTrainingHours;
attendedTrainingHours = attTrainingHours;
}
void TeamLeader::setMonthlyBonus(int bonus)
{
monthlyBonus = bonus;
}
void TeamLeader::setRequiredTrainingHours(int hours)
{
requiredTrainingHours = hours;
}
void TeamLeader::setAttendedTrainingHours(int hours)
{
attendedTrainingHours = hours;
}
int TeamLeader::getMonthlyBonus() const
{
return monthlyBonus;
}
int TeamLeader::getRequiredTrainingHours() const
{
return requiredTrainingHours;
}
int TeamLeader::getAttendedTrainingHours() const
{
return attendedTrainingHours;
}
Main.cpp
#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
#include "Employee.h"
#include "ProductionWorker.h"
#include "TeamLeader.h"
using namespace std;
int main()
{
string name, number, date;
int shift, requiredTrainingHours, attendedTrainingHours;
int hourlyPay, monthlyBonus;
// Get employee information
cout << "Enter employee name: ";
getline(cin, name);
cout << "Enter employee ID: ";
getline(cin, number);
cout << "Enter hire date: ";
getline(cin, date);
cout << "Enter shift (1 for day, 2 for night): ";
cin >> shift;
cout << "Enter pay rate: ";
cin >> hourlyPay;
cout << "Enter bonus rate: ";
cin >> monthlyBonus;
cout << "Enter training hours: ";
cin >> attendedTrainingHours;
cout << "Enter required hours: ";
cin >> requiredTrainingHours;
// Create team leader object
TeamLeader tl(name, number, date, shift, hourlyPay, monthlyBonus, requiredTrainingHours,
attendedTrainingHours);
// Display employee and production worker information
cout << "===================================" << endl;
cout << "The employee name : " << tl.getEmployeeName() << endl;
cout << fixed << setprecision(2) << "The Pay Rate : " << tl.getHourlyPay() << endl;
cout << "The employee ID : " << tl.getEmployeeNumber() << endl;
cout << "The Hire Date : " << tl.getHireDate() << endl;
cout << "Shift : " << (tl.getShift() == 1 ? "Day" : "Night") << endl;
// Display team leader information
cout << fixed << setprecision(2) << "Bonus Rate : " << tl.getMonthlyBonus() << endl;
cout << "Training hours : " << tl.getAttendedTrainingHours() << endl;
cout << "Required hours : " << tl.getRequiredTrainingHours() << endl;
return 0;
}

More Related Content

Similar to This code has nine errors- but I don't know how to solve it- Please g.pdf

in C++ Design a class named Employee The class should keep .pdf
in C++ Design a class named Employee The class should keep .pdfin C++ Design a class named Employee The class should keep .pdf
in C++ Design a class named Employee The class should keep .pdfadithyaups
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfrajkumarm401
 
getting errors in the Product-cpp file error- (Expected function bo.pdf
getting errors in the Product-cpp file error-    (Expected function bo.pdfgetting errors in the Product-cpp file error-    (Expected function bo.pdf
getting errors in the Product-cpp file error- (Expected function bo.pdfNicholasflqStewartl
 
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdf
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdfGetting error - (Return type of out-of-line definition of 'Product--Ge (1).pdf
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdfNicholasflqStewartl
 
C++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfC++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfjaipur2
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfankit11134
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfarasanmobiles
 
Why won't my code build and run- getting errors in the inventorysystem.pdf
Why won't my code build and run- getting errors in the inventorysystem.pdfWhy won't my code build and run- getting errors in the inventorysystem.pdf
Why won't my code build and run- getting errors in the inventorysystem.pdfJosephuugPaynet
 
In this assignment, you will continue working on your application..docx
In this assignment, you will continue working on your application..docxIn this assignment, you will continue working on your application..docx
In this assignment, you will continue working on your application..docxjaggernaoma
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxDeepasCSE
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfarjuncollection
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxnormanibarber20063
 
Modify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdfModify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdfaaseletronics2013
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportMatthew Zackschewski
 

Similar to This code has nine errors- but I don't know how to solve it- Please g.pdf (20)

in C++ Design a class named Employee The class should keep .pdf
in C++ Design a class named Employee The class should keep .pdfin C++ Design a class named Employee The class should keep .pdf
in C++ Design a class named Employee The class should keep .pdf
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
getting errors in the Product-cpp file error- (Expected function bo.pdf
getting errors in the Product-cpp file error-    (Expected function bo.pdfgetting errors in the Product-cpp file error-    (Expected function bo.pdf
getting errors in the Product-cpp file error- (Expected function bo.pdf
 
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdf
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdfGetting error - (Return type of out-of-line definition of 'Product--Ge (1).pdf
Getting error - (Return type of out-of-line definition of 'Product--Ge (1).pdf
 
C++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdfC++ Please I am posting the fifth time and hoping to get th.pdf
C++ Please I am posting the fifth time and hoping to get th.pdf
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdf
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
 
Why won't my code build and run- getting errors in the inventorysystem.pdf
Why won't my code build and run- getting errors in the inventorysystem.pdfWhy won't my code build and run- getting errors in the inventorysystem.pdf
Why won't my code build and run- getting errors in the inventorysystem.pdf
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
In this assignment, you will continue working on your application..docx
In this assignment, you will continue working on your application..docxIn this assignment, you will continue working on your application..docx
In this assignment, you will continue working on your application..docx
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdf
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
Modify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdfModify the Time classattached to be able to work with Date.pdf
Modify the Time classattached to be able to work with Date.pdf
 
OOPS 22-23 (1).pptx
OOPS 22-23 (1).pptxOOPS 22-23 (1).pptx
OOPS 22-23 (1).pptx
 
Class ‘increment’
Class ‘increment’Class ‘increment’
Class ‘increment’
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End Report
 

More from aamousnowov

Theresa has many iCU potsents in her care- Some of the potients are on.pdf
Theresa has many iCU potsents in her care- Some of the potients are on.pdfTheresa has many iCU potsents in her care- Some of the potients are on.pdf
Theresa has many iCU potsents in her care- Some of the potients are on.pdfaamousnowov
 
Theresa has many ICU patients in her care- Some of the patients are on.pdf
Theresa has many ICU patients in her care- Some of the patients are on.pdfTheresa has many ICU patients in her care- Some of the patients are on.pdf
Theresa has many ICU patients in her care- Some of the patients are on.pdfaamousnowov
 
There is duality between monitors and message passing- What is that du (1).pdf
There is duality between monitors and message passing- What is that du (1).pdfThere is duality between monitors and message passing- What is that du (1).pdf
There is duality between monitors and message passing- What is that du (1).pdfaamousnowov
 
There are several types of interests that may be at stake in a negotia.pdf
There are several types of interests that may be at stake in a negotia.pdfThere are several types of interests that may be at stake in a negotia.pdf
There are several types of interests that may be at stake in a negotia.pdfaamousnowov
 
There is an unequal distribution of news coverage regarding disasters-.pdf
There is an unequal distribution of news coverage regarding disasters-.pdfThere is an unequal distribution of news coverage regarding disasters-.pdf
There is an unequal distribution of news coverage regarding disasters-.pdfaamousnowov
 
There is an archaeological study area located in southwestern NewMexic.pdf
There is an archaeological study area located in southwestern NewMexic.pdfThere is an archaeological study area located in southwestern NewMexic.pdf
There is an archaeological study area located in southwestern NewMexic.pdfaamousnowov
 
There is a disease called by two copies of a recessive allele- xx- On.pdf
There is a disease called by two copies of a recessive allele- xx- On.pdfThere is a disease called by two copies of a recessive allele- xx- On.pdf
There is a disease called by two copies of a recessive allele- xx- On.pdfaamousnowov
 
There are two ways that the tilt of the Earth's axis causes the summer.pdf
There are two ways that the tilt of the Earth's axis causes the summer.pdfThere are two ways that the tilt of the Earth's axis causes the summer.pdf
There are two ways that the tilt of the Earth's axis causes the summer.pdfaamousnowov
 
There doesn't appear to be a statistical difference in the means (you'.pdf
There doesn't appear to be a statistical difference in the means (you'.pdfThere doesn't appear to be a statistical difference in the means (you'.pdf
There doesn't appear to be a statistical difference in the means (you'.pdfaamousnowov
 
There have been many examples where the use of AI and Data Mining to m.pdf
There have been many examples where the use of AI and Data Mining to m.pdfThere have been many examples where the use of AI and Data Mining to m.pdf
There have been many examples where the use of AI and Data Mining to m.pdfaamousnowov
 
There has been a debate over how climate change impact the incidence a.pdf
There has been a debate over how climate change impact the incidence a.pdfThere has been a debate over how climate change impact the incidence a.pdf
There has been a debate over how climate change impact the incidence a.pdfaamousnowov
 
There are 60 students in a class- 10 are graduate students- We form a.pdf
There are 60 students in a class- 10 are graduate students- We form a.pdfThere are 60 students in a class- 10 are graduate students- We form a.pdf
There are 60 students in a class- 10 are graduate students- We form a.pdfaamousnowov
 
Theme- Understanding relevance and centrality based information reteri.pdf
Theme- Understanding relevance and centrality based information reteri.pdfTheme- Understanding relevance and centrality based information reteri.pdf
Theme- Understanding relevance and centrality based information reteri.pdfaamousnowov
 
There are 100 inhabitants on a remote island in the year 2000 - The po.pdf
There are 100 inhabitants on a remote island in the year 2000 - The po.pdfThere are 100 inhabitants on a remote island in the year 2000 - The po.pdf
There are 100 inhabitants on a remote island in the year 2000 - The po.pdfaamousnowov
 
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdf
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdftheir state of happiness (Happy or Not Happy) and income (Low- Medium-.pdf
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdfaamousnowov
 
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdf
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdfThere are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdf
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdfaamousnowov
 
The z-test statistic is (Raund to two docimal plizces as naodod-).pdf
The z-test statistic is (Raund to two docimal plizces as naodod-).pdfThe z-test statistic is (Raund to two docimal plizces as naodod-).pdf
The z-test statistic is (Raund to two docimal plizces as naodod-).pdfaamousnowov
 
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdf
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdfThere are 15 freshmen and 17 sophomore students in a classroom- We ran.pdf
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdfaamousnowov
 
There are numerous sales apps that are very popular with sales people.pdf
There are numerous sales apps that are very popular with sales people.pdfThere are numerous sales apps that are very popular with sales people.pdf
There are numerous sales apps that are very popular with sales people.pdfaamousnowov
 
There are several benefits to incorporating a business- Which of the f.pdf
There are several benefits to incorporating a business- Which of the f.pdfThere are several benefits to incorporating a business- Which of the f.pdf
There are several benefits to incorporating a business- Which of the f.pdfaamousnowov
 

More from aamousnowov (20)

Theresa has many iCU potsents in her care- Some of the potients are on.pdf
Theresa has many iCU potsents in her care- Some of the potients are on.pdfTheresa has many iCU potsents in her care- Some of the potients are on.pdf
Theresa has many iCU potsents in her care- Some of the potients are on.pdf
 
Theresa has many ICU patients in her care- Some of the patients are on.pdf
Theresa has many ICU patients in her care- Some of the patients are on.pdfTheresa has many ICU patients in her care- Some of the patients are on.pdf
Theresa has many ICU patients in her care- Some of the patients are on.pdf
 
There is duality between monitors and message passing- What is that du (1).pdf
There is duality between monitors and message passing- What is that du (1).pdfThere is duality between monitors and message passing- What is that du (1).pdf
There is duality between monitors and message passing- What is that du (1).pdf
 
There are several types of interests that may be at stake in a negotia.pdf
There are several types of interests that may be at stake in a negotia.pdfThere are several types of interests that may be at stake in a negotia.pdf
There are several types of interests that may be at stake in a negotia.pdf
 
There is an unequal distribution of news coverage regarding disasters-.pdf
There is an unequal distribution of news coverage regarding disasters-.pdfThere is an unequal distribution of news coverage regarding disasters-.pdf
There is an unequal distribution of news coverage regarding disasters-.pdf
 
There is an archaeological study area located in southwestern NewMexic.pdf
There is an archaeological study area located in southwestern NewMexic.pdfThere is an archaeological study area located in southwestern NewMexic.pdf
There is an archaeological study area located in southwestern NewMexic.pdf
 
There is a disease called by two copies of a recessive allele- xx- On.pdf
There is a disease called by two copies of a recessive allele- xx- On.pdfThere is a disease called by two copies of a recessive allele- xx- On.pdf
There is a disease called by two copies of a recessive allele- xx- On.pdf
 
There are two ways that the tilt of the Earth's axis causes the summer.pdf
There are two ways that the tilt of the Earth's axis causes the summer.pdfThere are two ways that the tilt of the Earth's axis causes the summer.pdf
There are two ways that the tilt of the Earth's axis causes the summer.pdf
 
There doesn't appear to be a statistical difference in the means (you'.pdf
There doesn't appear to be a statistical difference in the means (you'.pdfThere doesn't appear to be a statistical difference in the means (you'.pdf
There doesn't appear to be a statistical difference in the means (you'.pdf
 
There have been many examples where the use of AI and Data Mining to m.pdf
There have been many examples where the use of AI and Data Mining to m.pdfThere have been many examples where the use of AI and Data Mining to m.pdf
There have been many examples where the use of AI and Data Mining to m.pdf
 
There has been a debate over how climate change impact the incidence a.pdf
There has been a debate over how climate change impact the incidence a.pdfThere has been a debate over how climate change impact the incidence a.pdf
There has been a debate over how climate change impact the incidence a.pdf
 
There are 60 students in a class- 10 are graduate students- We form a.pdf
There are 60 students in a class- 10 are graduate students- We form a.pdfThere are 60 students in a class- 10 are graduate students- We form a.pdf
There are 60 students in a class- 10 are graduate students- We form a.pdf
 
Theme- Understanding relevance and centrality based information reteri.pdf
Theme- Understanding relevance and centrality based information reteri.pdfTheme- Understanding relevance and centrality based information reteri.pdf
Theme- Understanding relevance and centrality based information reteri.pdf
 
There are 100 inhabitants on a remote island in the year 2000 - The po.pdf
There are 100 inhabitants on a remote island in the year 2000 - The po.pdfThere are 100 inhabitants on a remote island in the year 2000 - The po.pdf
There are 100 inhabitants on a remote island in the year 2000 - The po.pdf
 
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdf
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdftheir state of happiness (Happy or Not Happy) and income (Low- Medium-.pdf
their state of happiness (Happy or Not Happy) and income (Low- Medium-.pdf
 
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdf
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdfThere are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdf
There are 24 evenly distributed nodes on an 8 port 100 BaseT HUB- What.pdf
 
The z-test statistic is (Raund to two docimal plizces as naodod-).pdf
The z-test statistic is (Raund to two docimal plizces as naodod-).pdfThe z-test statistic is (Raund to two docimal plizces as naodod-).pdf
The z-test statistic is (Raund to two docimal plizces as naodod-).pdf
 
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdf
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdfThere are 15 freshmen and 17 sophomore students in a classroom- We ran.pdf
There are 15 freshmen and 17 sophomore students in a classroom- We ran.pdf
 
There are numerous sales apps that are very popular with sales people.pdf
There are numerous sales apps that are very popular with sales people.pdfThere are numerous sales apps that are very popular with sales people.pdf
There are numerous sales apps that are very popular with sales people.pdf
 
There are several benefits to incorporating a business- Which of the f.pdf
There are several benefits to incorporating a business- Which of the f.pdfThere are several benefits to incorporating a business- Which of the f.pdf
There are several benefits to incorporating a business- Which of the f.pdf
 

Recently uploaded

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 

Recently uploaded (20)

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 

This code has nine errors- but I don't know how to solve it- Please g.pdf

  • 1. This code has nine errors, but I don't know how to solve it. Please give me a code that resolves all errors and executes well. Please provide the code for each file name. ( Employee.h, Employee.cpp, ProductionWorker.h, ProductionWorker.cpp, TeamLeader.h, TeamLeader.cpp, Main.cpp) Employee.h #include <iostream> #include <cstdlib> #include <string> #include <iomanip> using namespace std; class Employee { private: string employeeName; string employeeNumber; string hireDate; public: Employee(); // default constructor Employee(string name, string number, string date); // constructor with parameters void setEmployeeName(string employeeName); // set employee name void setEmployeeNumber(string employeeNumber); // set employee number void setHireDate(string hireDate); // set hire date string getEmployeeName() const; // get employee name string getEmployeeNumber() const; // get employee number string getHireDate() const; // get hire date }; Employee.cpp #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "Employee.h" Employee::Employee() {
  • 2. cout << "Please answer some questions about your employees. " << endl; } // Constructor with parameters Employee::Employee(string name, string number, string date) { employeeName = name; employeeNumber = number; hireDate = date; } // Set employee name void Employee::setEmployeeName(string name) { employeeName = name; } // Set employee number void Employee::setEmployeeNumber(string number) { employeeNumber = number; } // Set hire date void Employee::setHireDate(string date) { hireDate = date; } // Get employee name string Employee::getEmployeeName() const { return employeeName; } // Get employee number string Employee::getEmployeeNumber() const { return employeeNumber; } // Get hire date string Employee::getHireDate() const { return hireDate; }
  • 3. ProductionWorker.h #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "Employee.h" using namespace std; class ProductionWorker : public Employee { private: int shift; int hourlyPay; public: ProductionWorker(); // default constructor ProductionWorker(string name, string number, string date, int s, int pay); // constructor with parameters void setShift(int shift); // set shift void setHourlyPay(int pay); // set hourly pay int getShift() const; // get shift int getHourlyPay() const; // get hourly pay }; ProductionWorker.cpp #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "ProductionWorker.h" // Default constructor ProductionWorker::ProductionWorker() { cout << "Your responses will be displayed after all data has been received." << endl; } // Constructor with parameters ProductionWorker::ProductionWorker(string name, string number, string date, int s, int pay) : Employee(name, number, date) { shift = s;
  • 4. hourlyPay = pay; } // Set shift void ProductionWorker::setShift(int s) { shift = s; } // Set hourly pay void ProductionWorker::setHourlyPay(int pay) { hourlyPay = pay; } // Get shift int ProductionWorker::getShift() const { return shift; } // Get hourly pay int ProductionWorker::getHourlyPay() const { return hourlyPay; } TeamLeader.h #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "ProductionWorker.h" using namespace std; class TeamLeader : public ProductionWorker { private: int monthlyBonus; int requiredTrainingHours; int attendedTrainingHours; public: TeamLeader();
  • 5. TeamLeader(string name, string number, string date, int s, int pay, int bonus, int reqTrainingHours, int attTrainingHours); void setMonthlyBonus(int bonus); void setRequiredTrainingHours(int hours); void setAttendedTrainingHours(int hours); int getMonthlyBonus() const; int getRequiredTrainingHours() const; int getAttendedTrainingHours() const; }; TeamLeader.cpp #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "TeamLeader.h" TeamLeader::TeamLeader() { cout << "Your responses will be displayed after all data has been received." << endl; } TeamLeader::TeamLeader(string name, string number, string date, int s, int pay, int bonus, int reqTrainingHours, int attTrainingHours) : ProductionWorker(name, number, date, s, pay) { monthlyBonus = bonus; requiredTrainingHours = reqTrainingHours; attendedTrainingHours = attTrainingHours; } void TeamLeader::setMonthlyBonus(int bonus) { monthlyBonus = bonus; } void TeamLeader::setRequiredTrainingHours(int hours) { requiredTrainingHours = hours; } void TeamLeader::setAttendedTrainingHours(int hours) {
  • 6. attendedTrainingHours = hours; } int TeamLeader::getMonthlyBonus() const { return monthlyBonus; } int TeamLeader::getRequiredTrainingHours() const { return requiredTrainingHours; } int TeamLeader::getAttendedTrainingHours() const { return attendedTrainingHours; } Main.cpp #include <iostream> #include <cstdlib> #include <string> #include <iomanip> #include "Employee.h" #include "ProductionWorker.h" #include "TeamLeader.h" using namespace std; int main() { string name, number, date; int shift, requiredTrainingHours, attendedTrainingHours; int hourlyPay, monthlyBonus; // Get employee information cout << "Enter employee name: "; getline(cin, name); cout << "Enter employee ID: "; getline(cin, number); cout << "Enter hire date: "; getline(cin, date);
  • 7. cout << "Enter shift (1 for day, 2 for night): "; cin >> shift; cout << "Enter pay rate: "; cin >> hourlyPay; cout << "Enter bonus rate: "; cin >> monthlyBonus; cout << "Enter training hours: "; cin >> attendedTrainingHours; cout << "Enter required hours: "; cin >> requiredTrainingHours; // Create team leader object TeamLeader tl(name, number, date, shift, hourlyPay, monthlyBonus, requiredTrainingHours, attendedTrainingHours); // Display employee and production worker information cout << "===================================" << endl; cout << "The employee name : " << tl.getEmployeeName() << endl; cout << fixed << setprecision(2) << "The Pay Rate : " << tl.getHourlyPay() << endl; cout << "The employee ID : " << tl.getEmployeeNumber() << endl; cout << "The Hire Date : " << tl.getHireDate() << endl; cout << "Shift : " << (tl.getShift() == 1 ? "Day" : "Night") << endl; // Display team leader information cout << fixed << setprecision(2) << "Bonus Rate : " << tl.getMonthlyBonus() << endl; cout << "Training hours : " << tl.getAttendedTrainingHours() << endl; cout << "Required hours : " << tl.getRequiredTrainingHours() << endl; return 0; }