import java.util.Stack;
import java.util.Queue;
import java.util.LinkedList; 
import java.util.Scanner; 
/**
 * Chapter 14 Homework skeleton
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class chap14HwkSkeleton
{
    /** ask the user for a list of numbers that you will use 
     * to test all 3 methods
     * When using this, be sure to test with a list 0 long, 
     * some lists with only positive
     * some lists with only negative
     * and some lists with mixed negative and positive
     */
    public static void main (String[] args)
    {

        Stack<Integer> entryStack = new Stack<Integer>();
        Scanner s = new Scanner(System.in);
        System.out.println("How many numbers do you want to enter");
        int max = s.nextInt();
        for (int c = 0; c < max; c++){
            System.out.println("Enter number");
            entryStack.push(s.nextInt());
        }
        System.out.println("The original stack is " 
            + entryStack);
        // make 3 separate copies 
        Stack<Integer> testStack1 = StackToStack(entryStack);
        Stack<Integer> testStack2 = StackToStack(entryStack);
        Stack<Integer> testStack3 = StackToStack(entryStack);
        // run the 3 methods and print the result
        splitStack(testStack1);
        System.out.println("The stack with all positives on top of negatives is " 
            + testStack1);
        stutter(testStack2);
        System.out.println("The stack with repetitions is " 
            + testStack2);
        Stack<Integer> theCopy = copyStack(testStack3);
        System.out.println("The stack as a duplicate copy is  " 
            + theCopy);

    }

    public static Stack<Integer> StackToStack(Stack<Integer> s){
        Stack<Integer> result = new Stack<Integer>();
        Stack<Integer> hold = new Stack<Integer>();
        // put all the values from the input stack to the hold stack
        // it will reverse the order
        while(!s.isEmpty()){
            hold.push(s.pop());
        }
        // put all the values from the hold stack back 
        // to both the original and return stacks
        while (!hold.isEmpty()){
            Integer num = hold.pop();
            result.push(num);
            s.push(num);
        }
        return result;
    }

    public static void splitStack(Stack<Integer> n){
        Queue<Integer> hold = new LinkedList<Integer> ();
 
    }

    public static void stutter( Stack<Integer> n) {
        Queue<Integer> hold = new LinkedList<Integer> ();
     
    }

    public static Stack<Integer> copyStack( Stack<Integer> n) {
        Queue<Integer> hold = new LinkedList<Integer> ();
        Stack<Integer> ans = new Stack<Integer>();
  
        return ans;
    }
}
