Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compiler: CPP (gcc-5.x) L. solution.cpp Employee and Salary Class Define a class Employee with data members as int employee_id - To store employee ID. String

Compiler: CPP (gcc-5.x) L. solution.cpp Employee and Salary Class Define a class Employee with data members as int employee_id - To store employee ID. String employee_name - To store the name of the employee. Define class Salary which inherits Employee class and has the following characteristics Data members String designation - To store employee designation. double monthly_salary - To store salary of the employee. Methods constructor Salary(int employee_id, String employee_name, String designation, double monthly_salary) - Invokes a superclass constructor and initialize data members. void display() - To display details of employees whose earning is more than 20,000. Details of an employee should be separated by spaces. solution.cpp 1 #include 2 using namespace std; 3 4. int main() 5{ 6 // Write your code here 7 } + Add Custom Test Case Input 3 123 John engineer 40000 OUTPUT CODE REVIEW COMMENT 124 Emma Testing 33000 125 White Trainee Engineer 20000 where, First line represents the number of employees whose details are provided. Second line represents employee ID. Third line represents employee name. Fourth line represents designation of the employee. Fifth line represents employee salary per month. The remaining lines represent the details of the remaining employees in the same format as given above. Output 123 John engineer 40000.0 124 Emma Testing 33000.0 The output displayed details of employees who earn more than 20,000.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

With an unreceptive audience, focus on areas of agreement.

Answered: 1 week ago