Question: Java programming Do the same question with Map Array class Worker private static String woid; private static String woname; private static int wopos; private static

Java programming Do the same question with Map Array

Java programming Do the same question with Map Array class Worker private

class Worker private static String woid; private static String woname; private static int wopos; private static float wosalary public void set wosalary(float salary) { wosalaryssalary; } public static String get woid() { return woid; } public static String get wonamel) { return woname; } public static int get wopos() { return wopos } public static float get wosalary() { return wosalary } public void set woid(String id) { woid=id; } public void set_woname(String name) { woname=name; } public void set wopos(int ipos) { wopos=ipos } w w } Q1. (MT-2 Fall 2012) Write a method named "read workers" that will get a ListArray of objects (class Worker) as an argument (named workerlist). Your function has to ask user the worker Id, Worker Name, Worker position, and Worker salary, and save these input as the properties of an object which has to be inserted into the workerlist. On every end of the input turn, your method has to ask user as "Would you like to input for one more worker? (Y/N)". On choise "Y" or "y", it has to read the next worker data. Solution public static void read workers List workerlist) Worker worker_char ch='N'; do { worker = new Worker(); worker.set_woid JOptionPane_showInputDialog("Enter The Worker ld")); worker.set wonamelJOptionPane showInput Dialog("Enter The Worker Name")); worker.set wopos(Integer.parseInt(JOptionPane.showInputDialog "Enter The Worker Position")); worker.set_wosalary(Float.parseFloat(JOptionPane.showInputDialog "Enter The Worker Salary"): workerlist.add(worker); ch-OptionPane.showInputDialog("Would you want to input one more worker?(Y/N)"); //??? } while ((ch==') (sh=='')); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!