(solution) Assignment 2 Due Date: December 2, 2015 To Submit: The source

(solution) Assignment 2 Due Date: December 2, 2015 To Submit: The source

I need urgent help with a simple Java Applet question. I have attached the relevant question and the text file needed. It would be ideal if you could submit the answer as a single source file, ‘UpdateEmp.java.

Thanks in advance!

Assignment 2
Due Date: December 2, 2015
To Submit: The source file, UpdateEmp.java.
Instructions for File Submission: Please upload your source file through Moodle.
Description:
Suppose that a university stores its employee records in a text file called ?Emp.txt?. The
file is available next to this assignment description.
The employee records are modeled using the following Record class:
public class Record {
private int empId;
private String telephone;
private String name;
private int years_of_Work;
public Record() {
empId = 0;
telephone = null;
name = null;
years_of_Work = 0;
}
public Record(int e, String t, String n, int y) {
empId = e;
telephone = t;
name = n;
years_of_Work = y;
}
public void setEmpId(int e) {
empId = e;
}
public void setName(String n) {
name = n;
}
public void setTelephone(String t) {
telephone = t;
}
public void setYears(int y) {
years_of_Work = y;
}
public int getEmpId() {
return empId;
}
public String getName() {
return name;
}
public STring getTelephone() {
return telephone;
}
public int getYears() { return years_of_Work;
}
public String toString() {
return name + " phone=" + telephone + " years of work=" +
years_of_Work + "
";
}
} Your task is to write the Java applet UpdateEmp which presents the user interface shown
below. All the user induced action in this applet is associated with the 3 buttons.
a) When the ?Get Record? button is first clicked the applet will retrieve the first
record from the text file and will display the information in the corresponding
textfields. Next time the ?Get Record ?button is clicked the second record from
the text file will be retrieved etc. The text file has one record per line with the
fields: employeeId, telephone, name, years_of_Work separated by spaces.
For example, the file contains the record:
10 416-555-6666 Burgess 15 ________________________________________________________________
Note: The space below the button Display All Records is a text area. b) The user is allowed to change information in all the textfields, except in the first
textfield which contains the employeeId value. Then by clicking the ?Update?
button the user will send the information from the textfields into an array of
100 Record objects. Simultaneously the textfields of the applet are made empty.
c) Assume that the user used the buttons ?Get Record? and ?Update? to create an
array of Record objects containing all the information of the text file. At the end
the user will click on the ?Display All Records? button and the information stored
in the array of Record objects will be displayed in the TextArea sorted by names
in alphabetic order. Use the method toString() of the Record class and the Bubble
Sort method for sorting. 2 3