C++ I need help with this program not working ####### main.cpp############ #incl
ID: 3728504 • Letter: C
Question
C++ I need help with this program not working
####### main.cpp############
#include "..Project2employee.h"
using namespace std;
const string DIRECTIONS = "Enter new employee.";
void getemployeeInformation(employee& payment) {
string name;
int hours;
float MIN_WAGE = 8.5;
float MAX_WAGE = 65.0;
float wage;
getString("customer Name", name);
payment.setName(name);
getNumber("hours of work ", payment.MIN_Hours, payment.MAX_Hours, hours);
payment.setHours(hours);
getNumber("wages ", payment.MIN_WAGE, payment.MAX_WAGE, wage);
payment.setWage(wage);
}
void displayemployeeInformation(employee payment) {
displaySeparator();
cout << payment.getemployeeInformation() << endl;
}
int main() {
employee Payment;
string CustomerName;
int hours;
float wage;
do {
getString("First Name", CustomerName);
Payment.setName(CustomerName);
getNumber("Hours Worked", 0, 75, hours);
Payment.setHours(hours);
getNumber("wages ", 8.5, 65.00, wage);
Payment.setWage(wage);
cout << "Employee Name:" << Payment.getName() << endl;
cout << "Hours worked: " << Payment.getHours() << endl;
cout << "Gross Pay : " << Payment.getcalcualteGross << endl;
} while (keepGoing());
terminateApplication("employee");
return 0;
}
############employee.h##################
#include "..employee1employee.h"
using namespace std;
class employee
{
private:
string CustomerName;
int hours;
float wage, gross;
public:
employee();
const int MIN_Hours = 0;
const int MAX_Hours = 75;
const string DEFAULT_NAME = "Not given";
const float MIN_WAGE = 8.5;
const float MAX_WAGE = 65.0;
void setName(string CustomerName);
string getName();
void setHours(int hours);
int getHours() ;
void setWage(float wage);
float getWage();
float getcalcualteGross(float gross);
string getemployeeInformation();
};
###############employee.cpp###############
#include "..employee.h"
employee::employee()
{
const int MIN_Hours = 0;
const int MAX_Hours = 75;
const float MIN_WAGE = 8.5;
const float MAX_WAGE = 65.0;
CustomerName = DEFAULT_NAME;
int hours;
float wage;
}
void employee::setName(string CustomerName)
{
if (!CustomerName.empty()) {
this->CustomerName = CustomerName;
}
}
string employee::getName()
{
return CustomerName;
}
void employee::setHours(int hours)
{
if (hours >= MIN_Hours && hours <= MAX_Hours) {
this->hours = hours;
}
else if (hours < MIN_Hours) {
this->hours = MIN_Hours;
}
else {
this->hours = MAX_Hours;
}
}
int employee::getHours()
{
return hours;
}
void employee::setWage(float wage)
{
if ((wage >= MIN_WAGE && wage <= MAX_WAGE)) {
this->wage = wage;
}
else if (wage < MIN_WAGE) {
this->wage = MIN_WAGE;
}
else {
this->wage = MAX_Hours;
}
}
float employee::getWage()
{
return wage;
}
float employee::getcalcualteGross(float gross)
{
return hours * wage;
}
string employee::getemployeeInformation()
{
string str = "employee " + CustomerName;
str += " Hours: " + numToString(hours);
str += " Wage: " + numToString(wage);
str += " Gross Pay: " + numToString(getcalcualteGross(gross));
return str;
}
Explanation / Answer
str += " Hours: " + std::to_string(hours);
str += " Wage: " + std::to_string(wage);
str += " Gross Pay: " + std::to_string(getcalcualteGross(gross));
return str;
Hope this will help!!!{
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.