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:
Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation.
Answer:
A) corrective.
B) adaptive.
C) perfective.
Explanation:
Making changes due to an error is corrective, making changes in order to be able to accommodate new methods is adaptive, and changes in strict adherence to regulations must be perfective.