subject

Given the following code, what logic would you need to include to determine how many times the number 2 appears within the array: int[] myArray = {1,2,3,2,5,6,2,8,2,10};

for (int i = 0; i < myArray. length; i++) {
//your code goes here
}
Sample Output: The number 2 appears 4 times in this array.
NOTE: Your response should be just the missing logic--not the entire problem set.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 23.06.2019 01:10
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
You know the right answer?
Given the following code, what logic would you need to include to determine how many times the numbe...
Questions
question
English, 01.03.2021 16:40
question
Mathematics, 01.03.2021 16:40
question
History, 01.03.2021 16:40
question
Business, 01.03.2021 16:40
question
Mathematics, 01.03.2021 16:40
question
Mathematics, 01.03.2021 16:40
Questions on the website: 13722361