Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a Java class namely Employee containing: Instance variables: - id: A private instance variable of type integer. - name: A private instance variable of

Define a Java class namely Employee containing: Instance variables: - id: A private instance variable of type integer. - name: A private instance variable of type String. - salary: A private instance variable of type double. - workedHour: A private instance variable of type double. Methods: - full-parameterized constructor: a constructor method to initialize the instantiated objects.

setname( xxx ): acts as the set method for the attribute name - setid(xxx): acts as the set method for the attribute id - setsalary(xxx): acts as the set method for the attribute salary - setworkedHour(xxx): acts as the set method for the attribute workedHour. - getname (): acts as the get method for the attribute name - getid (): acts as the get method for the attribute id - getsalary (): acts as the get method for the attribute salary - getworkedHour (): acts as the get method for the attribute workedHour. - display(): print the attributes id, name, and salary in the following format: id" ,"name", "salary".

Define a Java class TestEmployee that contains a main method and test the functionality of the above class Employee - Create three objects of type Employee

image text in transcribed

Name of object id name workedHour salary El 1001 Mohammed 44 2000 E2 1002 Omar 38 4000 E3 1003 Khaled 45 5400

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_2

Step: 3

blur-text-image_3

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions