ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 8.00

LinearSearch

LinearSearch

Write a Java program, called LinearSearch that contains a static method called findElement() that accepts a double array and a double as its parameters and return a boolean value if the double number entered is contained in the double array. In the main method you should use user input to take in the length of the array to be filled, then the elements of the array, and finally the element you wish to search for in the array. You program should call findElement() to check for the occurence of the double number entered in the array. You should print an appropriate message to the screen if the element is found.

 

Input:

n mi mi+1 mi+2 .... mi+n x, where n is the length of the array, mi is an element in the array and x is the element that is being searched for.

 

Sample input 1:

4.0 345.6 678.954 234.534 -89.23 678.954

 

Sample input 2:

4.0 345.6 678.954 234.534 -89.23 67.4

 

Output:

A message stating if the element is found.

 

Sample output 1:

678.954 was found in the array

 

Sample output 2 :

67.4 was NOT found in the array

Answers

(11)
Status NEW Posted 03 May 2017 02:05 AM My Price 8.00

-----------

Not Rated(0)