AP Java 2 Assignment 3:
Searching

Background

In this assignment you will write two searching methods that search through an array of objects.; one using binary search and one using linear search. The array of objects represents the inventory at a store. Each item has a catalog number and a number that represents the number of that item in stock. You may want to read through ICT Java lessons 27 and 28 for more information on searching an array of objects.

Steps to starting this assignment

You will then need to create a new empty project with the files BinStoreSearch.html and BinStoreSearch.java . Right click on the files and store them in your folder. (Important note: Make sure when saving BinStoreSearch.html to choose save as "BinStoreSearch.html" with the double quotes.)Then:

  1. Choose Project | New Project | Empty Project. Name your project BinStoreSearch
  2. Choose Project | Add Files and add the files you just downloaded.
  3. Choose Window and choose the first BinStoreSearch listed.
  4. You should now be able to run the applet

Steps to completing this assignment

Now that your applet runs, you will need to complete the following methods:

Note that you need to write two versions of binarySearch, one recursive, and the other using a loop.

When you are finished, post your completed applet to your website, and submit the code for the three completed methods to mrsimon@lycos.com: