import java.util.*;
/**
 *  Using arrays 
 * 
 *
 * @author Kathryn
 * @version February 2007
 * 
 * 1) Go through string operations and array operations
 * 2) Motivate that this structure is not the best and that we
 *    would probably like an array that links the name and inventory
 *    together 
 * 3) Create an Items class to correlate the "object"
 * 4) What constructors and methods do we need?
 */
public class Inventory
{
    public static void main(String[] args)
    {
        Items[] apples;
        
        Scanner stdin = new Scanner(System.in);
        System.out.println("Please enter how many types of apples are in Inventory");
        int numberApples = stdin.nextInt();
        
        apples = new Items[numberApples];
    
        apples[0] = new Items("Fuji", 12);
        
        Items a = apples[0];
        // try setting a break point and then double clicking on the apples array, and a
 
/*        
        int[] inventory = new int[4];
        String[] appleNames = new String[4];
        
        appleNames[0] = "Grapple";
        inventory[0] = 0;
        appleNames[1] = "Red Delicious";
        inventory[1] = 30;
        appleNames[2] = "Fuji";
        inventory[2] = 100;
        appleNames[3] = "Gala";
        inventory[3] = 27;
        
        inventory[1] = inventory[1] - 6;
        inventory[3] -= 4;
        
        int max = 0;  // the index of the maximum apple inventory
        for (int i = 0; i < inventory.length; i++) {
          System.out.println(inventory[i] + " apples of type " + appleNames[i] + ".");   
          if (inventory[max] < inventory[i]) {
              max = i;
            }
        }
        System.out.println("The largest inventory is " + inventory[max] 
            + " of apples of type " + appleNames[max]);   
            
        String myApples = "apples";
        
        char c1 = myApples.charAt(1);
        int position = myApples.indexOf("e");
        String sub = myApples.substring(1, 2);
        String sup = sub.concat(myApples);
        boolean same = sup.equals(sub);
        
        c1 = appleNames[1].charAt(5);
        position = appleNames[1].indexOf("e");
        sub = appleNames[1].substring(0, 3);
        sup = sub.concat(appleNames[1]);
        same = sup.equals(sub);
 */     
    }
}
