write the following eight methods and write a main function to test these methods:
// return the index of the first occurrence of key in arr // if key is not found in arra, return -1 public static int linearsearch(int arr[], int key) // soert the arr from least to largest by using select sort algorithm public stati void selectsort(int arr[]) // print out all array elements. 5 elements per line public static void printarray(int arr[]) // assign each element in array with a random number // between 1 and 100, inclusive public static void initializearray(int arr[]) // find the range of all array elements // the range is defined as the difference between the largest and smallest elements public static int range(int arr[]) // find the largest element in array public static int largst(int arr[]) // find the smallest element in array public static int smallest(int arr[]) // find the average value of all elements in array public static double average(int arr[])
sample pseudo code for main function
1. declare an int array of size 10 2. initialize the array by calling initializearray function 3. print out the array by calling printarray function 4. print out the largest and smallest value of the array by using system. out. prinln and calling largest and smalles functions 5. print out the range of the array 6. print out the average of the array elements 7. ask user to enter a search key 8. call the linearsearch function with array and key. based on result, print out appropriate message 9. call the selectsort function to sort the array. 10. print out array again to see the sorted array
use online resource: you may search on line to find the linear search and select sort algorithms.
b for sure (if your smart try and answer my recent math question lol and b sounds lit
Answer from: Quest
d. local area network (lan)
explanation:
a local area network (lan) is a collection of computers it connected to one another or to a common connection medium.
i hope this you, and have a wonderful day!
Answer from: Quest
go to edit profile, preferences, then choose level and select the desired choice.
Answer from: Quest
Answer the lady gave a violent start and stared in bewilderment at my companion;
Another question on Computers and Technology
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?