Jan 10, 2022 at 5:26pm UTC
Sure! How to avoid Compilation errors below?
I've added Date Class and its data members to combine with Employee derived classes.
I need to stay in this context and make the program work
Employee.h:24:14: error: ‘virtual void Employee::print() const’ cannot be overloaded with ‘void Employee::print() const’
24 | virtual void print() const; // virtual
In file included from SalariedEmployee.cpp:5:
SalariedEmployee.h:11:36: error: default argument missing for parameter 5 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
SalariedEmployee.h:11:22: note: ...following parameter 4 which has a default argument
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~~~~~~~~~~
SalariedEmployee.h:11:41: error: default argument missing for parameter 6 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
SalariedEmployee.h:11:46: error: default argument missing for parameter 7 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
In file included from CommissionEmployee.cpp:5:
CommissionEmployee.h:11:49: error: default argument missing for parameter 6 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:22: note: ...following parameter 4 which has a default argument
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~~~~~~~~~~
CommissionEmployee.h:11:53: error: default argument missing for parameter 7 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:57: error: default argument missing for parameter 8 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
In file included from BasePlusCommissionEmployee.h:6,
from BasePlusCommissionEmployee.cpp:5:
CommissionEmployee.h:11:49: error: default argument missing for parameter 6 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:22: note: ...following parameter 4 which has a default argument
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~~~~~~~~~~
CommissionEmployee.h:11:53: error: default argument missing for parameter 7 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:57: error: default argument missing for parameter 8 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
In file included from Main.cpp:8:
SalariedEmployee.h:11:36: error: default argument missing for parameter 5 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
SalariedEmployee.h:11:22: note: ...following parameter 4 which has a default argument
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~~~~~~~~~~
SalariedEmployee.h:11:41: error: default argument missing for parameter 6 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
SalariedEmployee.h:11:46: error: default argument missing for parameter 7 of ‘SalariedEmployee::SalariedEmployee(const string&, const string&, const string&, double, int, int, int)’
11 | const std::string &, double = 0.0, int, int ,int);
| ^~~
In file included from Main.cpp:9:
CommissionEmployee.h:11:49: error: default argument missing for parameter 6 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:22: note: ...following parameter 4 which has a default argument
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~~~~~~~~~~
CommissionEmployee.h:11:53: error: default argument missing for parameter 7 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
CommissionEmployee.h:11:57: error: default argument missing for parameter 8 of ‘CommissionEmployee::CommissionEmployee(const string&, const string&, const string&, double, double, int, int, int)’
11 | const std::string &, double = 0.0, double = 0.0,int,int,int );
| ^~~
Last edited on Jan 10, 2022 at 5:59pm UTC