Duration: 90 minutes
Instructions:
You need to know at least one programming language to perform reasonably well on certain exam questions.
Students are not allowed to use IDEs such as NetBeans, IntelliJ IDEA, or similar software
to do the test.
You will get 0 (zero) for any answer which contains information irrelevant to the corresponding question.
Question 1 (3 points): Review the following class and find (at least) 5 issues in the code (i.e.,coding practice, compile errors, potential logical issues, etc.) (Use question 1 template)
1
2
3
4
5
6
7
8
9
public ArrayList<Integer> vicDiff(int[] ar1, int[] ar2){
ArrayList<Integer> Output = null;
int[] ar1 = {};
boolean found;
if(ar1 != null && ar2 != null) {
Output = new ArrayList<Integer>();
for(int item: ar1){
int i;
found = false;
10
System.out.println(found);
11
while(i <= ar2.length && found == false) {
12
if(item ar2[i])
13
found = true;
14
i++;
15
16
}
if(found)
Zoom
17
+ 100%
Output.add(item);
Close