Question: CourseSite. The starting code has the skeleton of a program that prompts the user to indicate what type of 2 dimensional they want to create

CourseSite. The starting code has the skeleton of a program that prompts the user to indicate what type of 2 dimensional they want to create (int or double) and the dimensions of said structure, but requires you to complete the following: 1. Creating the two-dimensional array. Based on the type that the user indicated (either i for int or d for double), create the appropriate type of 2D array in the main method. So: a. If the user types i, you should declare a two-dimensional array of integers of the dimensions indicated by the user (rows and cols) b. If the user types d, you should declare a two-dimensional array of doubles of the dimensions indicated by the user (rows and cols) 2. Filling the two-dimensional arrays. Overload a helper method, fillArrays () to assign elements within each array to either an int or double between 1 and 100. a. fillArray (int arrl) , b. fillArray (double arrl) 3. Calculate the average. Overload findAverage () to return the average (as a double) of the input array, defined to match the following signatures. a. findAverage (int arr1) { } b. findAverage (double arr1) ( )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
