Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

Briefly explain the term internal rate of return

Answered: 1 week ago

Question

Write down the Limitation of Beer - Lamberts law?

Answered: 1 week ago

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

love of humour, often as a device to lighten the occasion;

Answered: 1 week ago

Question

orderliness, patience and seeing a task through;

Answered: 1 week ago

Question

well defined status and roles (class distinctions);

Answered: 1 week ago