Question
Create a .java class called MoreArrayFun.java with only a main method. This program will use the ArrayManager class. The final version of the program is
Create a .java class called MoreArrayFun.java with only a main method. This program will use the ArrayManager class. The final version of the program is described below, but initially use it to test your ArrayManager class as you write it. Complete the ArrayManager class as specified below: The class will have exactly two instance variables: An array of integers A count of the number of elements currently in the array The class will have the following methods: A default constructor that creates the array with room for 100 integers and set the number of elements to 0 A fillArray method that will read integers from the file data.txt and store them in the array. This method has been partially written for you. You may assume that the file has no more than 100 items in it. A method that finds and returns the smallest value in the array, looking only at the values actually read in from the file. A method that finds and returns the largest value in the array, looking only at the values actually read in from the file. A method that accepts an integer parameter and returns the index of the first instance of the value in the array (looking only at the values actually read in from the file). If the value is not found, the method will return -1. Make sure that you stop looking as soon as you find the value. When you submit your program, your main must do the following: 1) Create an ArrayManager object using the default constructor 2) Call fillArray with that object 3) Print out the smallest value in the array with an appropriate label (having used the appropriate method to determine that value) 4) Print out the largest value in the array with an appropriate label (having used the appropriate method to determine that value) 5) Use a sentinel-controlled loop to ask the user for values and use the appropriate method to look up each value, printing the index with a label if found and Not found otherwise. Use a sentinel value of -999. Do not search for the sentinel value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started