subject

This is java programming:

objectives:

1. apply linear search algorithm
2. apply select sort algorithm
3. apply array iteration skill

question:

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Alex’s family members live in different parts of the world. they would like to discuss the wedding plans of one of their distant relatives. however, alex wants all the family members to talk to each other simultaneously so that they can make decisions quickly. which mode of internet communication should they use? a. blog b. email c. wiki d. message board e. instant messaging
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
What is estimated time of arrival (eta)? a device that measures the acceleration (the rate of change of velocity) of an item and is used to track truck speeds or taxi cab speeds a gps technology adventure game that posts the longitude and latitude location for an item on the internet for users to find a north/south measurement of position the time of day of an expected arrival at a certain destination and is typically used for navigation applications
Answers: 3
question
Computers and Technology, 23.06.2019 20:00
Match the file formats with the types of multimedia they can store
Answers: 2
You know the right answer?
This is java programming:

objectives:

1. apply linear search algorithm
Questions
question
Mathematics, 15.01.2021 19:10
question
Mathematics, 15.01.2021 19:10
question
History, 15.01.2021 19:10
question
History, 15.01.2021 19:10
question
Chemistry, 15.01.2021 19:10
question
History, 15.01.2021 19:10
question
Mathematics, 15.01.2021 19:10