Note for programmer: 1. Do this in c++ programming language and use oop concepts. 2. Look at the pic attatched first 3. Write a separate main() function as a driver for each question. The driver should demonstrate all the required functionalities of a question. 4. Your code must be generic, well-commented, and well-organized. It should not have compilation errors. Each class should have private data members. Each class should also contain constructors (default, parametrized, and copy constructor if needed), a destructor, setters, and getters. Each class should be implemented in separate .h and .cpp files. .................................................................................................................................................. Description of Program: Make sure to use the data encapsulation techniques, where necessary. The details for each class are given below. Project: Each project has a “project ID” and “project details” (write any random details about the project here). There is non-parameterized constructor to instantiate a Project object. Using getters and setters, get the values and set the “id” and “project details”. The ID must be at least 1 or greater than this. “Show details” function must return the Project ID and Project Details as a string. Employee: There is a “name”, “employee id” and a “project” associated with each employee. There are getters and setters that should be used to get and set the values of “employee name” and “id” and should validate the input too. The ID cannot be less than 1. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string. Salaried Employee: Getter and setter are used to set the “monthly salary”. Monthly salary must be above Rs. 30,000. “GetSalary” returns the monthly salary as an integer. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string. Commission Employee: Gross sales show the total sales achieved by the employee. Getters and setters are used to get and set the gross sales and base salary values. Base salary must be above 20,000. Gross sales must be a positive integer value. 1.5% Commission is only given to the employee if the gross sales exceed Rs. 100, 000 and is calculated using the formula: Commission = gross sales * 0.015 “calculateSalary” function calculates the total salary of the employee and sets the “total salary”vattribute to the calculated salary using the following formula: Total salary = base salary + commission “GetTotalSalary” returns the total salary as a floating number. “Show details” function must return the Employee ID, name, Project ID and Project Details as a string. Hourly Employee: Getters and setters are used to retrieve and set the values of “no of hours” and “hourly rate”. No of hours worked must be at least 30 and the hourly rate must be at least Rs. 150 “calculateSalary” function calculates the total salary using the given formula and sets the “total salary” attribute to the result of the calculation: Total salary = no of hours * hourly rate “GetTotalSalary” returns the total salary as an integer. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string. To Do: Write a driver code to test all the functions; you can hardcode the values instead of taking the inputs from the user. You can also make other utility functions as needed if that makes your program simpler and/or easier to read. Your program should not crash on the edge cases or illegal inputs.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Note for programmer:

1. Do this in c++ programming language and use oop concepts.

2. Look at the pic attatched first

3. Write a separate main() function as a driver for each question. The driver should demonstrate all the required functionalities of a question.

4. Your code must be generic, well-commented, and well-organized. It should not have compilation errors. Each class should have private data members. Each class should also contain constructors (default, parametrized, and copy constructor if needed), a destructor, setters, and getters. Each class should be implemented in separate .h and .cpp
files.

..................................................................................................................................................

Description of Program:

Make sure to use the data encapsulation techniques, where necessary. The details for each class are given below.
Project:
Each project has a “project ID” and “project details” (write any random details about the project here).
There is non-parameterized constructor to instantiate a Project object. Using getters and setters, get the values and set the “id” and “project details”. The ID must be at least 1 or greater than this. “Show details” function must return the Project ID and Project Details as a string.
Employee:
There is a “name”, “employee id” and a “project” associated with each employee.

There are getters and setters that should be used to get and set the values of “employee name” and “id” and should validate the input too. The ID cannot be less than 1. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string.
Salaried Employee:
Getter and setter are used to set the “monthly salary”. Monthly salary must be above Rs. 30,000.
“GetSalary” returns the monthly salary as an integer. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string.
Commission Employee:
Gross sales show the total sales achieved by the employee. Getters and setters are used to get and
set the gross sales and base salary values.
Base salary must be above 20,000. Gross sales must be a positive integer value.
1.5% Commission is only given to the employee if the gross sales exceed Rs. 100, 000 and is
calculated using the formula:

Commission = gross sales * 0.015

“calculateSalary” function calculates the total salary of the employee and sets the “total salary”vattribute to the calculated salary using the following formula:
Total salary = base salary + commission

“GetTotalSalary” returns the total salary as a floating number. “Show details” function must return the Employee ID, name, Project ID and Project Details as a string.
Hourly Employee:
Getters and setters are used to retrieve and set the values of “no of hours” and “hourly rate”. No of hours worked must be at least 30 and the hourly rate must be at least Rs. 150 “calculateSalary” function calculates the total salary using the given formula and sets the “total salary” attribute to the result of the calculation:

Total salary = no of hours * hourly rate

“GetTotalSalary” returns the total salary as an integer. “Show details” function must return the Employee ID, name, salary, Project ID and Project Details as a string.

To Do:
Write a driver code to test all the functions; you can hardcode the values instead of taking the inputs from the user. You can also make other utility functions as needed if that makes your program simpler and/or easier to read. Your program should not crash on the edge cases or illegal inputs.

getSalary()
showDetails()
Commission
Employee
Gross Sales
(Integer)
Getter and setters for gross salary
and base salary
Base Salary
(Integer)
getTotalSalary()
Total salary (Float)
calculateSalary()
showDetails()
Hourly Employce
|No of hours
(Integer)
Getters and setters for number of
hours and hourly rate.
Hourly rate
(Integer)
caleulateSalary()
Total Salary
(Integer)
getTotalSalary()
showDetails()
Make sure to use the data encapsulation techniques, where necessary. The details for each class
are given below,
Transcribed Image Text:getSalary() showDetails() Commission Employee Gross Sales (Integer) Getter and setters for gross salary and base salary Base Salary (Integer) getTotalSalary() Total salary (Float) calculateSalary() showDetails() Hourly Employce |No of hours (Integer) Getters and setters for number of hours and hourly rate. Hourly rate (Integer) caleulateSalary() Total Salary (Integer) getTotalSalary() showDetails() Make sure to use the data encapsulation techniques, where necessary. The details for each class are given below,
Question 2:
Consider the following UML Diagram.
Employee
Project
SalariedEmployee
CommissionEmployee
HourlyEmployee
In the above given dingram, it can be seen that "Salaried Employee", "Commission Employee"
and "Hourly Employee" are inherited from the "Employee" class. (Recall the concepts of
inheritance)
Assume that cach employee is assigned a project so cach employce has a project on which he is
working on. (Recall the concepts of Aggregation)
The attributes and methods for cach class are given in the table below.
Class
Attributes
Functior
5/9
Project
Project Id
(Integer)
| Constructor
Project Details (String)
Getters and Setter for Project Id
and Project Details
showDetails()
Employee
Name
(String)
| Getters and setters for name and
employee id
Employee Id (String)
showDetails()
Project
(Project class' objecet)
Salaried Employee
Monthly Salary (Integer)
Getter and setter for salary
Transcribed Image Text:Question 2: Consider the following UML Diagram. Employee Project SalariedEmployee CommissionEmployee HourlyEmployee In the above given dingram, it can be seen that "Salaried Employee", "Commission Employee" and "Hourly Employee" are inherited from the "Employee" class. (Recall the concepts of inheritance) Assume that cach employee is assigned a project so cach employce has a project on which he is working on. (Recall the concepts of Aggregation) The attributes and methods for cach class are given in the table below. Class Attributes Functior 5/9 Project Project Id (Integer) | Constructor Project Details (String) Getters and Setter for Project Id and Project Details showDetails() Employee Name (String) | Getters and setters for name and employee id Employee Id (String) showDetails() Project (Project class' objecet) Salaried Employee Monthly Salary (Integer) Getter and setter for salary
Expert Solution
steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY