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 22:00
Competent nonverbal communication involves interacting with others in a manner that is appropriate for which of the following? select all that apply. situation task individuals
Answers: 3
question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Based on the current economic situation do you expect the employment demand for graduating engineers to increase or decrease? explain the basis for your answer. with a significant economic recovery, what do you think will happen to future enrollments in graduating engineering programs?
Answers: 1
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
Mathematics, 11.07.2021 22:10
question
Mathematics, 11.07.2021 22:10
question
Mathematics, 11.07.2021 22:10
Questions on the website: 13722360