Question
JAVA Write a comment on each method Write a class Employee that includes the following hidden (private) attributes: name (String), department (String) and salary (double).
JAVA
Write a comment on each method
Write a class Employee that includes the following hidden (private) attributes: name (String), department (String) and salary (double). Create a setter and a getter for each of them. The setter of salary is override by another one that gets bonus parameter (as percentage). The class includes a static and public member count (int) that represents the number of created Employee objects that incremented automatically after each created one then create a getter for it.
Crate main classes that achieve the following: a. Create an array of 10 Employee objects, created permanently, read by Scanner and read by JOptionPane, (one program for each). b. Access the objects for bonus using the formula: salary = salary * bonus (e.g. bonus = 1.2) c. Sort the objects by name and salary, (one program for each) d. Show the sorted Employee data using Command Line, JOptionPane, (one program for each). e. Access the number of objects by the count member.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started