hey so I have this assignment that requires me to create a mini program with a menu system that has options 1 and 2. Option 1 requires me to use JOptionPane to input and store people's names and their salaries using arrays (not arraylist). After that, option 2 will display the list of peoples names and salaries. However, I am unsure specifically on how to store user's input from JOptionPane into an array and later display it. Any help would be much appreciated! thank you!
public class HR{
public static void getName(){
String[] name= new String[20];
for (int count=0;count<1;count++){
name[count]= JOptionPane.showInputDialog(null,"Please enter employee's name:", JOptionPane.QUESTION_MESSAGE);
}
}
public static void getSalary(){
String[] salary= new String[20];
for (int count=0;count<1;count++){
salary[count]= JOptionPane.showInputDialog(null,"Please enter employee's salary:", JOptionPane.QUESTION_MESSAGE);
}
}