Question: Question No : 2 2 A company maintains a database that has the details of all the employees. There are two levels of employees where

Question No : 22
A company maintains a database that has the details of all the employees. There are two levels of employees where Level 1 is the top management having a salary of more than 10000 and Level 2 is the staff who are getting a salary less than 10000
Create classes as below:
class Employee (Parent Class)
parameters: id, salary
Method: displayEmp (display employee id and salary details)
class EmpLevel (child class of Employee)
parameters: Inherit from the parent class
Method: findEmpLevel (print whether the employee belongs to Level l or Level 2)
Create an object for the EmpLevel class and call displayEmp and findEmplevel methods.
Input format :
The input should contain only the employee id (integer) and salary (float) of the employee separated by space.
Output format :
The program output must display the employee id, salary, and level of the employee one below the other in the same order.
Sample test cases :
Marks : 10 Negative Marks : 0
Question No: 2/2
Sample test cases :
\table[[Input 1:,Output 1:],[10120000,101],[,20000.0]]
Input 2:
Output 2 :
1359500
135
9500.0
Level 2
Code Size : 1024 kb
Note:
 Question No : 22 A company maintains a database that has

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!