akosiraff

Download LinearSearchJava

Jan 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/linearsearchjava/
  3. LinearSearchJava
  4. This assignment is worth 10 points. Your work is due at the beginning of next class. You will
  5. turn in two class printouts.
  6. 1. (6 points) Complete the linear search method from today’s lecture. Create a class
  7. containing this method (as a static member) and a main method that, when run, creates
  8. and initializes an array with 100 random numbers and calls your search method for at
  9. least 5 values, three which are in the array and two which are not.
  10. Use System.out.printf to report the results of each search. Test your program and
  11. print out the class.
  12. Note: the size of the array (100) should be defined using a constant field of the class.
  13. 2. (4 points) Modify the program to create an array large enough to hold 10,000 random
  14. numbers. Otherwise it should work as before. If you wrote the first version of the
  15. program well, you shouldn’t have to change much at all. Test as before, and print out your
  16. modified class.
  17. 3. There is a better way to specify the size of the array that we want the program to create
  18. and fill with random numbers, so we don’t have to change the code every time we want to
  19. test a different array size.
  20. Do you know what it is?
  21. Prepare to discuss this question in class (nothing to turn in).
  22.  
  23. Download: https://solutionzip.com/downloads/linearsearchjava/
Add Comment
Please, Sign In to add comment