Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

There are two functions listed below, within the hour if you can, please point o

ID: 3882350 • Letter: T

Question

There are two functions listed below, within the hour if you can, please point out some of the main bugs you see in these programs, it doesn't have to be immensely detailed, I just want to make sure I caught most of them.

1)

2) NEXT Function

public void run0 HashMap map; map put("C$198" "awesome") map.put("section leading" fun) .. Fill with more data. removeKeysContainingString (m ap"so" This Java method takes in a HashMap and a string, then loops through the map and removes all entries that have a key containing that string void removeKeysContainingString (HashMap

Explanation / Answer

Program 1:

HashMap is just declared and is not initialized with new function.. Thats wrong

In the function, string comparison is done using (==) operator, which is wrong.. it should be done using .equals() method.

Problem 2:
This seems to be a C/C++ code.. so the array which we are returnign, need to be created dynamically using malloc or calloc.. it can not be a local array, as local variables are vanished outside the function.
Also array is not initialized properly.. first we need to initialize an array of pointers and then we need to fill those array with individual single arrays.