subject

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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
If you turn on the lock alpha button , what happens
Answers: 1
question
Computers and Technology, 22.06.2019 20:40
Assume that there is a 4% rate of disk drive failure in a year. a. if all your computer data is stored on a hard disk drive with a copy stored on a second hard disk drive, what is the probability that during a year, you can avoid catastrophe with at least one working drive? b. if copies of all your computer data are stored on three independent hard disk drives, what is the probability that during a year, you can avoid catastrophe with at least one working drive?
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
You know the right answer?
Write a class named employee that has the following fields: • name : the name field is a string obj...
Questions
question
Physics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Mathematics, 07.01.2021 04:30
question
Chemistry, 07.01.2021 04:30
Questions on the website: 13722361