package assign2;
/**
* M Madden, Nov 2005: Test the ArrayStack ADT
*/
import javax.swing.JOptionPane;
public class Test //testing the program
{
public static void main(String[] args)
{
int stackLength=0;
int queueLength=0;
String stackL = JOptionPane.showInputDialog("Input a stack capacity:");
//input stack capacity
try
{
stackLength = Integer.parseInt(stackL); //parse to int
}
catch(NumberFormatException e)
{
System.out.println("You have not entered a valid number!");
return;
}
try
{
String queueL = JOptionPane.showInputDialog("Input a queue capacity:");
//input queue capacity
queueLength = Integer.parseInt(queueL); //parse to int
}
catch(NumberFormatException e)
{
System.out.println("You have not entered a valid number!");
return;
}
String testword = JOptionPane.showInputDialog("Please enter a word:");
//receive input
Test1.Testcase(testword, stackLength, queueLength); //pass in the word,
the stack and the queue
}