I am having an issue with declaring a construtor - LINE 104  TimeOff::TimeOff(string, int, double, double, double, double, double) Can you review my code and let me know what I am doing wrong.  I got help from your site, however, they created 2 files, a header and a source cpp. My assignment is to turn in one file, with the headers and source code. See below and attached  //Sharissa R Sullivan  //03.18.23 //More about Classes #include #include using namespace std; //Number Days Class class NumDays {     // Access specifer  private:     double hours;     double days; public:     NumDays(double h = 0)     {         hours = h;         days = h / 8;     }     void setHours(double h)     {         hours = h;         days = h / 8;     }     void setDays(double d)     {         days = d;         hours = d * 8;     }     double getHours()const     {         return hours;     }     double getDays()const     {         return days;     }     //overloaded + operator     NumDays operator+(NumDays& right)     {         NumDays temp;         temp.setHours(hours + right.getHours());         return temp;     }     //overloaded - operator     NumDays operator -(NumDays& right)     {         NumDays temp;         temp.setHours(hours - right.getHours());         return temp;     }     //overloaded prefix ++     NumDays operator ++()     {         ++hours;         days = hours / 8;         return *this;     }     //overloaded operator postfix ++     NumDays operator ++(int)     {         hours++;         NumDays temp(hours);         days = hours / 8;         return temp;     }     //overloaded operator prefix --     NumDays operator --()     {         --hours;         days = hours / 8;         return *this;     }     //overloaded operator postfix--     NumDays operator --(int)     {         hours--;         NumDays temp(hours);         days = hours / 8;         return temp;     } }; class TimeOff { // Declare name and ID number variables  private:      string name;     int empNumber; // create objects from the Numdays Class      NumDays         maxSickDays,         sickTaken,         maxVacation,         vacTaken,         maxUnpaid,         unpaidTaken; public:     //Declare Constructor      TimeOff(string = "", int = 0, double = 0, double = 0, double = 0, double = 0, double = 0);               // Mutators/ SET fucntions      void setname(string n)     {         name = n;     }     void setMaxSick(double h)     {         maxSickDays.setHours(h);     } //call the function "set hours" by passing hours      void setSickTaken(double h)     {         sickTaken.setHours(h);     //subtract "getMaxsick from hours          setMaxSick(getMaxSick() - h);     }     void setMaxVacation(double h)     {         if (maxVacation.getHours() + h > 240)             maxVacation.setHours(240);         else             // call the "max vaction with hours             maxVacation.setHours(h);     }     //call the function set hours by passign hours      void setVactionTaken(double h)     {         vacTaken.setHours(h);         setMaxVacation(getMaxVacation() - h);     }     void setmaxUnpaid(double h)     {         maxUnpaid.setHours(h);     }          void setUnpaid(double h)     {         unpaidTaken.setHours(h);         setmaxUnpaid(_getmaxstdio() - h);     } // Get Functions/Accessors      // return max Sick days      string getName() const     {         return name;     }     double getMaxSick() const     {         return sickTaken.getHours();     }     double getMaxVacation() const     {         return maxVacation.getHours();     }     double getVactionTake() const     {         return vacTaken.getHours();     }     double getMaxUnpaid() const     {         return maxUnpaid.getHours();     }     double getUnpaidTaken() const     {         return unpaidTaken.getHours();     }     double getMaxSickDays() const     {         return maxSickDays.getDays();     }     double getSickTakenDays() const     {         return sickTaken.getDays();     }     double getMaxVactionDays() const     {         return maxVacation.getDays();     }     double getVacatoionDaysTaken() const     {         return vacTaken.getDays();     }     double getMaxUnpaidDays() const     {         return maxUnpaid.getDays();     }     double getUnpaidTakenDays()const     {         return unpaidTaken.getDays();     } }; int main() {              // create ogject for Time off class and pass values      TimeOff t("John,1234,0,0,0,0,0,0");     //declare varaibles      int months;     // v=vacation time  s= sick time      double v,s;     //Get the user to input the months      cout << "enter the months has" << t.getName() << "worked at the company:";     cin >> months;     // Calculate vanction and sick days      v = months * 12;     s = months * 8;     //call the function setMaxVacation      t.setMaxVacation(v);     t.setMaxSick(s);     //Dosplay the output      cout << "\nYour available vacation leave for" << t.getName() << "is:" << t.getMaxVactionDays() << "days\n";     cout << "\nYour available sick leave for" << t.getName() << "is:" << t.getMaxSickDays() << "days\n";     return 0; }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

I am having an issue with declaring a construtor - LINE 104  TimeOff::TimeOff(string, int, double, double, double, double, double)

Can you review my code and let me know what I am doing wrong. 

I got help from your site, however, they created 2 files, a header and a source cpp. My assignment is to turn in one file, with the headers and source code. See below and attached 

//Sharissa R Sullivan 
//03.18.23
//More about Classes

#include <iostream>
#include <string>
using namespace std;

//Number Days Class
class NumDays
{
    // Access specifer 
private:
    double hours;
    double days;
public:
    NumDays(double h = 0)
    {
        hours = h;
        days = h / 8;
    }
    void setHours(double h)
    {
        hours = h;
        days = h / 8;
    }
    void setDays(double d)
    {
        days = d;
        hours = d * 8;
    }
    double getHours()const
    {
        return hours;
    }
    double getDays()const
    {
        return days;
    }
    //overloaded + operator
    NumDays operator+(NumDays& right)
    {
        NumDays temp;
        temp.setHours(hours + right.getHours());
        return temp;
    }
    //overloaded - operator
    NumDays operator -(NumDays& right)
    {
        NumDays temp;
        temp.setHours(hours - right.getHours());
        return temp;
    }
    //overloaded prefix ++
    NumDays operator ++()
    {
        ++hours;
        days = hours / 8;
        return *this;
    }
    //overloaded operator postfix ++
    NumDays operator ++(int)
    {
        hours++;
        NumDays temp(hours);
        days = hours / 8;
        return temp;
    }
    //overloaded operator prefix --
    NumDays operator --()
    {
        --hours;
        days = hours / 8;
        return *this;
    }
    //overloaded operator postfix--
    NumDays operator --(int)
    {
        hours--;
        NumDays temp(hours);
        days = hours / 8;
        return temp;
    }
};


class TimeOff
{
// Declare name and ID number variables 
private: 
    string name;
    int empNumber;

// create objects from the Numdays Class 
    NumDays
        maxSickDays,
        sickTaken,
        maxVacation,
        vacTaken,
        maxUnpaid,
        unpaidTaken;
public:
    //Declare Constructor 
    TimeOff(string = "", int = 0, double = 0, double = 0, double = 0, double = 0, double = 0);
    
    
    // Mutators/ SET fucntions 
    void setname(string n)
    {
        name = n;
    }
    void setMaxSick(double h)
    {
        maxSickDays.setHours(h);

    }
//call the function "set hours" by passing hours 
    void setSickTaken(double h)
    {
        sickTaken.setHours(h);

    //subtract "getMaxsick from hours 

        setMaxSick(getMaxSick() - h);
    }

    void setMaxVacation(double h)
    {
        if (maxVacation.getHours() + h > 240)
            maxVacation.setHours(240);
        else
            // call the "max vaction with hours
            maxVacation.setHours(h);
    }
    //call the function set hours by passign hours 
    void setVactionTaken(double h)
    {
        vacTaken.setHours(h);

        setMaxVacation(getMaxVacation() - h);
    }
    void setmaxUnpaid(double h)
    {
        maxUnpaid.setHours(h);
    }
    
    void setUnpaid(double h)
    {
        unpaidTaken.setHours(h);
        setmaxUnpaid(_getmaxstdio() - h);
    }
// Get Functions/Accessors 
    // return max Sick days 

    string getName() const
    {
        return name;
    }
    double getMaxSick() const
    {
        return sickTaken.getHours();
    }

    double getMaxVacation() const
    {
        return maxVacation.getHours();
    }
    double getVactionTake() const
    {
        return vacTaken.getHours();

    }
    double getMaxUnpaid() const
    {
        return maxUnpaid.getHours();
    }
    double getUnpaidTaken() const
    {
        return unpaidTaken.getHours();
    }
    double getMaxSickDays() const
    {
        return maxSickDays.getDays();
    }
    double getSickTakenDays() const
    {
        return sickTaken.getDays();
    }
    double getMaxVactionDays() const
    {
        return maxVacation.getDays();
    }
    double getVacatoionDaysTaken() const
    {
        return vacTaken.getDays();

    }
    double getMaxUnpaidDays() const
    {
        return maxUnpaid.getDays();
    }
    double getUnpaidTakenDays()const
    {
        return unpaidTaken.getDays();
    }

};

int main()
{
        
    // create ogject for Time off class and pass values 
    TimeOff t("John,1234,0,0,0,0,0,0");

    //declare varaibles 

    int months;
    // v=vacation time  s= sick time 
    double v,s;

    //Get the user to input the months 

    cout << "enter the months has" << t.getName() << "worked at the company:";
    cin >> months;

    // Calculate vanction and sick days 
    v = months * 12;

    s = months * 8;

    //call the function setMaxVacation 
    t.setMaxVacation(v);
    t.setMaxSick(s);
    //Dosplay the output 
    cout << "\nYour available vacation leave for" << t.getName() << "is:" << t.getMaxVactionDays() << "days\n";
    cout << "\nYour available sick leave for" << t.getName() << "is:" << t.getMaxSickDays() << "days\n";

    return 0;
}



Textbook Question
BA Chapter 15, Problem 3PC
TeamLeader Class
In a particular factory, a team leader is an hourly paid production worker who leads a small team. In addition
to hourly pay, team leaders earn a fixed monthly bonus. Team leaders are required to attend a minimum
number of hours of training per year. Design a Team Leader class that extends the Production Worker class
you designed in Programming Challenge 1 (Employee and Production Worker Classes). The Team Leader
class should have member variables for the monthly bonus amount, the required number of training hours,
and the number of training hours that the team leader has attended. Write one or more constructors and the
appropriate accessor and mutator functions for the class. Demonstrate the class by writing a program that
uses a Team Leader object.
SAVE
Transcribed Image Text:Textbook Question BA Chapter 15, Problem 3PC TeamLeader Class In a particular factory, a team leader is an hourly paid production worker who leads a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus. Team leaders are required to attend a minimum number of hours of training per year. Design a Team Leader class that extends the Production Worker class you designed in Programming Challenge 1 (Employee and Production Worker Classes). The Team Leader class should have member variables for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Write one or more constructors and the appropriate accessor and mutator functions for the class. Demonstrate the class by writing a program that uses a Team Leader object. SAVE
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Windows
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education