Answer:
Explanation:
The following code is written in Python. It creates a class that takes in one ArrayList parameter and loops through it and calls two functions that check if the numbers are Perfect, Odd, or Even. Then it goes counting each and printing the final results to the screen.
class NumberAnalyzer:
def __init__(self, myArray):
perfect = 0
odd = 0
even = 0
for element in myArray:
if self.isPerfect(element) == True:
perfect += 1
else:
if self.isEven(element) == True:
even += 1
else:
odd += 1
print("# of Perfect elements: " + str(perfect))
print("# of Even elements: " + str(even))
print("# of Odd elements: " + str(odd))
def isPerfect(self, number):
sum = 1
i = 2
while i * i <= number:
if number % i == 0:
sum = sum + i + number / i
i += 1
if number == sum:
return True
else:
return False
def isEven(self, number):
if (number % 2) == 0:
return True
else:
return False
Answer:
Filtering procedure provides an essay and convenient way to visualize or work only with the data we desire without needing to delete those we do not need at that moment.
Filter allows you to view only the information you want to see. Only the required information is displayed at that moment once the filter criteria has been checked.
Filter temporarily hides rows of data that you do not need to view. Rows of data which aren't needed at the moment are temporarily hidden in other to allow user concentrate on the needed data.
Filter allows you to filter text and numeric data. Filtering allows for different filtering criteria, if the user requires working or viewing only on text or numeric data, it is possible with spreadsheet filter.
Explanation:
Filter allows you to view only the information you want to see.
Filter temporarily hides rows of data that you do not need to view
Filter allows you to filter text and numeric data.
Answer:
Explanation:
The following code is written in Java. I created both versions of the program that was described in the question. The outputs can be seen in the attached images below. Both versions are attached as txt files below as well.
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
txt
</span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark">
txt
</span>