Computers and Technology

Write a class named employee that has the following fields: β€’ name : the name field is a string object that holds the employee's name .β€’ idnumber: the idnumber is an int variable that holds the employee's id number.β€’ department: the department field is a string object that holds the name of the department where the employee works.β€’ position: the position field is a string object that holds the employee's job title. write appropriate mutator methods that store the values in these fields and accessor methods that return thevalues in these fields. once you have written the class , write a separateprogram that creates three employee objects to hold the following data: name id number department positionsusan meyers 47899 marketing sales repmark jones 39119 it programmerjoy rogers 81774 manufacturing engineerthe program should store this data in the three objects and then display the datafor each employee in the format: name , employee number id number, works as a position in department. for example: susan meyers, employee 47899, works as a sales rep in marketing. print each statement on a separate line in the order susan, mark, joy. sample run #0: java employeethe code i wrote: public class employee { // fields private string name; private int idnumber; private string department; private string position; // constructors public employee(string nm, int id, string dp, string ps) { name = nm; idnumber = id; department = dp; position = ps; } public employee(string nm, int id) { name = nm; idnumber = id; department = " "; position = " "; } public employee() { name = " "; idnumber = 0; department = " "; position = " "; } // methods public string getname() { return name; } public int getidnumber() { return idnumber; } public string getdepartment() { return department; } public string getposition() { return position; } }class employeefile{ public static void main(string[] args) { //different employee instances. employee box = new employee("susan meyers", 47899, "accounting", "vice pres"); employee box1 = new employee("mark jones", 39119, "it", "programmer"); employee box2 = new employee("joy rodgers", 81774, "manufacturing", "engineer"); system. out. println(" name id number department position "); system. out. println(""); system. out. print(" " + box. getname() + " " + box. getidnumber() + " " + box.; system. out. println(" " + box.; system. out. print(" " + box1.getname() + " " + box1.getidnumber() + " " + box1.; system. out. println(" " + box1.; system. out. print(" " + box2.getname() + " " + box2.getidnumber() + " " + box2.; system. out. println(" " + box2.; } }problems detected: β‡’ the contents of your standard output is incorrect. β‡’ failed 1 out of 1 test runs. failed test run β‡’ the contents of your standard output is incorrect. the error i got

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 06:30, QueeeenUknown7437
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, leleee10
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
image
Computers and Technology, 24.06.2019 00:00, BluedragonKBT44
The gene form of a trait is called a(n) 
Answers: 2
Do you know the correct answer?
Write a class named employee that has the following fields: β€’ name : the name field is a string obj...

Questions in other subjects:

Konu
English, 02.10.2019 19:50
Konu
Mathematics, 02.10.2019 19:50