QUOTE(webbywebb @ 14 Oct, 2008 - 09:33 AM)

i do not know where to start i am suppose to write a program to input names and wages for 5 workers. Then it searches one worker’s name by user’s input and removes all related findings. Lastly it outputs the highest, average, and lowest wages prior to removal and the current list of workers names and wages. You have to use Stack(s) for this program.
Sample Input and Output:
Please enter names for 5 workers:
Dave Mercy Jeff Jen Tina
Please enter wages for the above 5 workers:
1200 4000 3500 4000 2300
Please enter a worker’s name to search and then remove:
Dave
The highest wage is 4000.
The lowest wage is 1200.
The average wage is 3000.
The current list of names: Mercy Jeff Jen Tina.
The current list of wages: 4000 3500 4000 2300
this is what i have done so far
CODE
import java.io.InputStream;
import java.util.Scanner;
public class UseStack {
//
public static void main(String[] args) {
String input = "Hey My name is Patrick"; //Input to be displayed to user, backwards
int sizeofStack = input.length(); //length
Stack<Object> theStack = new ArrayStack<Object>(sizeofStack);
for (int c = 0; c < input.length(); c++) {
char ch = input.charAt(c);
try {
theStack.push(ch);//try
} catch (Exception e) {
// catch block
e.printStackTrace();
}//catch
}//end of for
while (!theStack.isEmpty()) {
char ch = 0;
try {
ch = theStack.pop();//try
} catch (Exception e) {
// catch block
e.printStackTrace();
}
System.out.print(ch);//System Print out input backwards
}
}//main
}//end of UseStack java