import java.util.*; 
/**
 * Exercises for arrays.
 * There are 2 main things to practice, adding to arrays, iterating through them whether it is printing them.
 * 
 *
 */
public class exercises
{
    ArrayList<Pet> pets = new ArrayList<Pet>();
    
    /**
     * This is created when exercises objects are created. This means the pets variable can be accessed anywhere!
     */
    public exercises(){
        pets.add(new Pet("dog",23));
        pets.add(new Pet("dog",13));
        pets.add(new Pet("dog",52));
        pets.add(new Pet("dog",24));
        pets.add(new Pet("dog",64));
        pets.add(new Pet("dog",15));
        pets.add(new Pet("cat",13));
        pets.add(new Pet("cat",13));
        pets.add(new Pet("cat",8));
        pets.add(new Pet("cat",15));
        pets.add(new Pet("cat",12));
        pets.add(new Pet("horse",120));
    }
    
    /**
     * Uncomment the following code and see what happens!
     * Can you add 3 more things to the items array and print the updated array?
     */
    public void printAllItems(){
        ArrayList<String> items = new ArrayList<String>(Arrays.asList("dog","cat","fish"));
        
        items.add("Apple");
        items.add("banana");
        items.add("this is the sixth item in the array");
        
        for (String s:items){
            System.out.println(s);
        }
        //System.out.println(items);
        //items.remove("cat");
        //items.remove(3);
        //YOUR CODE HERE
    }
    
    /**
     * use a for each loop to find the total of the numbers in the array.
     * You will need a extra variable!
     */
    public void findTotal(){
        ArrayList<Integer> numbers = new ArrayList<Integer>(Arrays.asList(8,3,5,7,2,6,9));
        //YOUR CODE HERE
    }
    
    /**
     * Use a for each loop to find the largest number in the array.
     * Again, you will need variables!
     */
    public void findLargest(){
        ArrayList<Integer> numbers = new ArrayList<Integer>(Arrays.asList(8,3,5,7,2,6,9));
        //YOUR CODE HERE
    }
    
    
    /**
     * Have the user enter a number. You tell them how many of the numbers are larger than the one they entered.
     */
    public void userLargest(){
        ArrayList<Integer> numbers = new ArrayList<Integer>(Arrays.asList(8,3,5,7,2,6,9));
        //YOUR CODE HERE
    }
   
    
    //These exercises involve arrays and Objects!
    
    /**
     * Create 5 pets and add them to the pets array.
     * Then print out the entire array with a for each loop
     */
    public void petAdd(){
        Pet rabbit = new Pet("rabbit", 10);
        pets.add(rabbit);
        //YOUR CODE HERE
    }
    
    /**
     * Find how many cats and dogs are in the array "pets"
     */
    public void petCount(){
        //YOUR CODE HERE
        for(Pet p: pets){
            System.out.println(p);//you will need to change this!
        }
    }
    
    /**
     * Find the total weights of all the pets in the array!
     */
    public void petWeightTotal(){
        //YOUR CODE HERE
    }
    
    /**
     * Ask the user for pets until the input "stop/quit/whatever you are used to"
     * For each pet they enter, you will need to ask them what type it is, and their weights.
     * 
     * Then print out how many pets were recorded and list them all with their wieghts.
     * 
     * Extension: Implement a "undo" button after a pet is added. While this is an extension for now, you will need this to pass the assessment!
     */
    public void petWeightUsers(){
        ArrayList<Pet> userPets = new ArrayList<Pet>();
        //YOUR CODE HERE
    }
}
