Answer:
Explanation:
The following code is written in Java and is a function/method that takes in an int array as a parameter. The type of array can be changed. The function then creates a counter and loops through each element in the array comparing each one, whenever one element is found to be a duplicate it increases the counter by 1 and moves on to the next element in the array. Finally, it prints out the number of duplicates.
public static int countDuplicate (int[] arr) {
int count = 0;
for(int i = 0; i < arr.length; i++) {
for(int j = i + 1; j < arr.length; j++) {
if(arr[i] == arr[j])
count++;
}
}
return count;
}
Answer:
Correct answer is:
communicate the purpose of the code that follows it.
Explanation:
Let have a look at each option
comment should give the reader the background of the programmer.
Comments are unable to do so.
Be written on every line
No, it is not need as comment are useful only to explain difficult or complex part of code.
communicate the purpose of the code that follows it.
yes, this option is true, as comments will give hints to programmer about the piece of code.
give information about how many hours it took to write the code
No, comments can answer it,
Im pretty sure it
<span>No automatic filtering
Partial automatic filtering
</span><span>Safe lists only
</span><span>High
</span>
Answer: B
Explanation: This question asks the student to consider the domain .org. The student needs to know that org is short for organization. This would point to option B. For option A to be true, the domain would need to be .com. Option C and D couldn’t be true, as there is no domain to point to these options. For option E to be true, the domain would need to be .gov.
Hope this helps! Comment below for more questions.