Unit 3 - TechJobs(Console) - findByValue


#1

Is there anyone here who has some understanding of the TechJobs(Console) assignment in Unit 3? I got it to print list of jobs (task 1), but task 2, finding a user-defined String in ANY column, is quite confusing. Can anyone shed some light on this???


#2

is this techjob(console) for java or c#


#3

It’s Java, but I’ve finished TechJobs. Now I’m on tasks related to Cheese(MVC).

Specifically I’m tasked with using a Cheese object to run the application. I have the Cheese class set up with data fields, a Constructor and getters/setters, and I think I’ve refactored the CheeseController correctly (not sure yet), but now I need to refactor the views. I’m not understanding the what/why/how of that because the application runs fine without doing anything to the views (index/add/delete). In light of that, it would not surprise me if I have not refactored the Controller correctly. Can you speak to any of this?


#4

I have the same question regarding TechJobs findByValue. I don’t understand what it is asking me to do that is different from findByColumnAndValue. Instructions. Enable a search that looks for the search term in all of the columns. I’m confused. Isn’t that what the code is already doing?

Summary

Provided code (from LaunchCode):
public static ArrayList<HashMap<String, String>> findByColumnAndValue(String column, String value) {
// load data, if not already loaded
loadData();
ArrayList<HashMap<String, String>> jobs = new ArrayList<>();
for (HashMap<String, String> row : allJobs) {
String aValue = row.get(column);
if (aValue.contains(value)) {
jobs.add(row);
}
}
return jobs;
}


#5

If it is like last year, the code is already searching in a particular column you can choose. You need to code in the case that ALL columns are searched at once-- ie if a keyword is in location, skill, or ANY of the columns. So, you will need to find a way to see if a given string exists in any of the set, possibly by iterating through them.