Write an array java program asking the user how many integer numbers to read in and create a one dimensional array of that size.  One program will do the following individual task in "inline" code: 1. After numbers have been obtained from the user (separate the input from output by a couple of blank lines) and stored in the array, search the array with a loop to find the smallest subscript (index) of the largest number and then print both the largest number and smallest subscript (index) for that number. 2. Next, search the array again with a separate loop to find the largest subscript (index) of the smallest number and then print both the largest subscript (index) for that number. 3. The program then should ask the user for yet another integer and will search the array for that integer, counting how many times that integer appears in the array before printing both the integer of interest and the count of how many times it appeared in the array. 4. Finally, the program will print the contents of the entire array horizontally on one line with three spaces between each value. 10 will be the query of how many numbers will occupy the array. -9, 100, 50, -30, 100, -30, 80, 50, 50, -9 will be the numbers as the contents of the array. 50 will be the query of what number to search for and count

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 6RQ
icon
Related questions
Question

Write an array java program asking the user how many integer numbers to read in and create a one dimensional array of that size. 

One program will do the following individual task in "inline" code:

1. After numbers have been obtained from the user (separate the input from output by a couple of blank lines) and stored in the array, search the array with a loop to find the smallest subscript (index) of the largest number and then print both the largest number and smallest subscript (index) for that number.

2. Next, search the array again with a separate loop to find the largest subscript (index) of the smallest number and then print both the largest subscript (index) for that number.

3. The program then should ask the user for yet another integer and will search the array for that integer, counting how many times that integer appears in the array before printing both the integer of interest and the count of how many times it appeared in the array.

4. Finally, the program will print the contents of the entire array horizontally on one line with three spaces between each value.

10 will be the query of how many numbers will occupy the array.

-9, 100, 50, -30, 100, -30, 80, 50, 50, -9 will be the numbers as the contents of the array.

50 will be the query of what number to search for and count

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage