For this question, assume all input comes from the keyboard, and all output goes to the screen. Include method prototypes and comments. The array should have room for 100 integers Write a complete Java program, including at least one comment in the main program and one in each method, to do the following Write a main program which will call the methods described below.(a) First the main program will read an integer (this integer is a parameter or header value) which it will callk Then the main program will call the method readdata( (see part 1 below) to read a set of data containing k values into an integer array which the main program will call x(b) The main program will call the method count5s) (see part 2 below), sending the x array (and k).(c) The main program will call the method sortarray() (see part 3 below) to sort the first k elements of the x array into descending order. The new values in the x array will be printed in the main prograrmDetails of the methods:1. Write a method called readdata() which receives two parameters, an integer n and an integer array arr The method will be sent a value for n. The method will read a set of n data items into the arr array. The method will print the set of data values as they are being read in2. Write a method called count5s) which receives two parameters, an integer n and an integer array v. The method will count how many of the first n elements of the v array are greater than 5, how many are less than 5 and how many are equal to 5 The method will print these values, with messages for each As an example: if the array holds the values 5 66 -4 5 1 -3, with n 6: there is 1 value greater than 5, there are 3 values less than 5, and there are 2 values equal to 5 3. Write a method called sortarray) which receives two parameters, an integer array w and an integer n giving the size of the array. The method will sort the first n elements of the w array into descending order. As an example, assume that method starts with these values in the w array: 5 66-4 5 1-3, with n = 6, Inside the method, these values will be sorted into descending order; the array will now hold 66 5 5 1 -3 -4

Respuesta :

A group of comparable data elements kept in close proximity to one another in memory is called an array. It is the most basic data structure because each data element may be immediately retrieved by using only its index number.

What is an array ?

The first k items of the x array will be sorted into descending order by the main program by calling the function sortarray(). An array is a collection of memory locations, or "boxes," each of which contains a single piece of data and which has the same identifier. An array must contain only elements of the same data type. Consider a scenario where a score table for a game needs to record ten scores.

A collection of elements (values or variables) is referred to as an array and is a type of data structure. Each element is identifiable by at least one array index or key. Array types may be confused with or overlap with other data types that express collections of values, such as lists and strings, depending on the language.

Therefore the correct answer is option C ) The main program will call the method sortarray() (see part 3 below) to sort the first k elements of the x array into descending order.

To learn more about array refer to :

https://brainly.com/question/29537583

#SPJ4

ACCESS MORE