Using java
This program has you create an array of integer values, thencreate and call some additional methods: find the smallest value,find the largest value, and count the number of even and oddvalues. Each step follows. When done, you'll have main() plus fouradditional methods.In main() construct an array of 30 random integers in the range of1 to 100, inclusive. Use the Random() class to do this. Display thearray; you can reuse your fvDisplay() code previously provided,adapted to integers.Add a statement to main() to call a new method that identifies thelargest integer value in the array and returns it to main(). Codethe method, and display the return value from main(). Sample:
Largest value found: 86Add a statement to main() to call a new method that identifies thesmallest integer value in the array and returns it to main(). Codethe method, and display the return value from main(). Sample:
Smallest value found: 86Add a statement to main() to call a new method that counts anddisplays the count of odd and even values in the array. Display theresults within the method, not in main(). Sample:
Odd numbers: 18Even numbers: 12
Using java This program has you create an array of integer values, then create and call some additional methods: find th
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am