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

WHAT ENERGY RELATIONSHIP EXIST BETWEEN THE IMMATURE HERRING, ARROW WORMS, AND ADULT HERRING?
graph the equation 5y-3x=-15
Which kingdom is most likely to contain organisms that are decomposers?
The WatergateWatermarkWaterfall scandal proved to be President Nixon's undoing.
After the success of the Sputnik launch in 1957, the US feared that
If the density and volume of an object is known, what can also be found?
Why do some people have dimples?
Dynamic stretching is considered a _____ exercise. muscular flexibility cardiovascular none of the above
What differentiates baseline activities from health-enhancing activities? the intensity of the activity the cost of the activity the participant in the activity
What expression is not equivalent to 1/343 A. 7-1 x 7-2 B.77 x 7-10 C. 7-2 x 7-5 D. 7-5 x 72 (All expressions have an Integer either negative or positive u j