Question: Can someone add comments that explain how the algorithm works and what data processing it is doing? 1.Create Class class Customer{ int custNo; String name;
Can someone add comments that explain how the algorithm works and what data processing it is doing?
1.Create Class class Customer{ int custNo; String name; String add; String doj; double price; } 2. Create Lists of Customer objects to store data List
4.Assign Initial indexes as 0 int i =0, j = 0; 5. Run the loop to merge the two lists while(i!=listpastjobs.size() && j! = listfuturejobs.size()) { if(listfuturejobs.get(j).custNo < listpastjobs.get(i).custNo) { listalljobs.add(listfuturejobs.get(j)); j++; } else if(listfuturejobs.get(j).custNo > listpastjobs.get(i).custNo) { listalljobs.add(listpastjobs.get(i)); i++; } else if(listfuturejobs.get(j).custNo < listpastjobs.get(i).custNo) { listalljobs.add(listfuturejobs.get(j)); j++;i++; } }
6. Store the listalljobs in a new file for(int i =0; i< listalljobs.size;i++) { File allCustomers.write(listalljobs.get(i)); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
