8.4 Programming Activity 1: Working with Arrays

In this activity, you will work with a 15-element integer array. Specifically, you will write the code to perform the following operations:

  1. fill the array with random numbers between 30 and 99

  2. print the array

  3. set every array element to a specified value

  4. count the number of elements with a specified value

  5. find the minimum value in the array

The framework for this Programming Activity will animate your algorithm so that you can check the accuracy of your code. For example, Figure 8.17 shows the application counting the elements having the value 73.

Figure 8.17Animation of the Programming Activity ...

Get Java Illuminated, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.