Question: C++ Write a C++ class, Employee, which contains the following member variables and member functions. Variables: 1. Employee ID: string 2. Employee name: an array

C++

Write a C++ class, Employee, which contains the following member variables and member functions. Variables: 1. Employee ID: string 2. Employee name: an array of character 3. age: an integer 4. gender: string 5. Basic salary: double; cannot be zero/negative

Functions: 1. A constructor () that creates students with initializing values for the specified member variables (id, name, age, gender, basic salary). 2. A function gross_salary_cal()-calculates the gross salary of an employee based on housing allowance (5% of basic salary), medical allowance (15% of basic salary) and transportation allowance (10% of basic salary). 3. A function tax_cal()-calculates the tax for all employees on a fixed rate of 5% of their gross salary. 3. A function print()-print all the information for an employee (name, id, age, gender, basic salary, gross salary, tax amount, salary after deduction of tax amount). Write the main function with the below steps: 1. Initiate 20 employees. 2. Calculates gross salary, tax and salary after deduction of tax for all those 20 employees. 3. Display all the information of 20 students.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!