joshualoz3034 joshualoz3034
  • 23-05-2018
  • Computers and Technology
contestada

Write the code to compute and output how many times the value 99 is found in an array of integers named numbers

Respuesta :

kaevras
kaevras kaevras
  • 24-05-2018
Thank you for being the rare question where you actually provide what language you want your answer in; I approve, and encourage this.

In Java, the following will work.
I made it a bit more versatile to work with others numbers, other than 99, if you so please (if not, just hardcode the 99 in yourself).

// Example list - fill this with numbers yourself.
ArrayList<Integer> nums = new ArrayList<>();
int n = 99;
int count = (int)nums.stream().filter(i -> i == n).count();
System.out.println(n + " occurences.");
Answer Link

Otras preguntas

please help me with this
Highlight the details that show actions. "Whoa there, Wind," I said softly as I tried to get near the stallion. "It's me, boy. It's Paul. " I extended my hand s
Which crops grow in the tierra fria?
Monomials!!!!!! HELP!!!!!! -7m - m^2 + 4m^2 - 3m
.Lauren has two bags of counters. Bag A has 4 red & 5 blue counters. Bag B has 3 red & 2 blue counters. She takes a counter at random from each bag Work
An electrolytic cell is set up to plate Zr(s) from a solution containing Zr4 (aq). A current of 7.92 amps is run through this solution for 6.16 hours. The mass
What is the role of the U.S. senate
The process of reinforcing successively closer approximations to a desired behavior is called.
Write an inequality that represents the graph. Use as the variable in the inequality. ​
Find the 7th term of the geometric progression which begins. 2,-6,18